Skip to content

Commit

Permalink
- Change Logout logic
Browse files Browse the repository at this point in the history
- Change redirect logic after language switching (to stay on the same page, instead of redirecting to the home page)
- Change navigation links & layout
- Change language switcher layout
  • Loading branch information
hackedhorizon committed Aug 18, 2024
1 parent 791513c commit a26917e
Show file tree
Hide file tree
Showing 28 changed files with 337 additions and 286 deletions.
10 changes: 5 additions & 5 deletions app/Livewire/Auth/Logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@

class Logout extends Component
{
public function mount()
{
$this->logout();
}

public function logout()
{
Auth::logout();
session()->invalidate();
session()->regenerate();
$this->redirect(route('home'), navigate: true);
}

public function render()
{
return view('livewire.auth.logout');
}
}
4 changes: 2 additions & 2 deletions app/Livewire/Features/LanguageSwitcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ public function render()
public function mount(LocalizationService $localizationService)
{
$this->selectedLanguage = $localizationService->getAppLocale();
$this->languages = collect(Config::get('app.locales'));
$this->languages = Config::get('app.locales');
}

public function updatedSelectedLanguage(LocalizationService $localizationService)
{
$localizationService->updateCurrentlySelectedLanguage(Auth::id(), $this->selectedLanguage);
$localizationService->setAppLocale($this->selectedLanguage);

return $this->redirect('/', navigate: true);
return $this->redirect(request()->header('Referer'), navigate: true);
}
}
13 changes: 13 additions & 0 deletions app/Livewire/Features/Navbar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Livewire\Features;

use Livewire\Component;

class Navbar extends Component
{
public function render()
{
return view('livewire.features.navbar');
}
}
13 changes: 13 additions & 0 deletions app/Livewire/User/Settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace App\Livewire\User;

use Livewire\Component;

class Settings extends Component
{
public function render()
{
return view('livewire.user.settings');
}
}
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"codeat3/blade-carbon-icons": "^2.23",
"codeat3/blade-eos-icons": "^1.14",
"codeat3/blade-google-material-design-icons": "^1.19",
"codeat3/blade-ikonate": "^1.5",
"danharrin/livewire-rate-limiting": "^1.3",
"davidhsianturi/blade-bootstrap-icons": "^1.5",
"guzzlehttp/guzzle": "^7.8.1",
"hasnayeen/blade-eva-icons": "^2.0",
"khatabwedaa/blade-css-icons": "^1.4",
Expand Down
135 changes: 134 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lang/en/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'success' => 'Welcome to CyberNexus, :username! Thank you for registering:)',
],
'info' => [
'no_notifications_available' => 'There aren\'t any notifications',
'title' => 'Notifications',
'no_notifications_available' => 'No notifications available',
],
];
4 changes: 2 additions & 2 deletions lang/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
"Hide": "Elrejt",
"Hide :name": "Elrejtés :name",
"Home": "Főoldal",
"Account": "Fiókom",
"Account data": "Fiók adatok",
"Account": "Profil",
"Account data": "Profil adatok",
"Dont have an account yet?": "Nincs még fiókod?",
"Already have an account?": "Van már fiókod?",
"HTTP Version Not Supported": "A HTTP-verzió nem támogatott",
Expand Down
3 changes: 2 additions & 1 deletion lang/hu/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'success' => 'Üdvözöllek az oldalon, :username! Jó böngészést!:)',
],
'info' => [
'no_notifications_available' => 'Nincs új értesítés',
'title' => 'Értesítések',
'no_notifications_available' => 'Nincsenek értesítések',
],
];
4 changes: 2 additions & 2 deletions resources/views/components/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
class="flex flex-col overflow-x-hidden transition-all duration-300 bg-center bg-default md:text-xl lg:text-2xl text-primary-500">

{{-- Toast messages --}}
<x-toast />
<x-toast position="toast-top toast-center" />

{{-- Email notification --}}
<x-notifications.verify-email-notification />

{{-- Navbar --}}
<x-navigation.navbar />
@livewire('features.navbar')

{{-- Main content --}}
<main class="flex items-center justify-center min-h-[calc(100vh-155px)] md:min-h-[calc(100vh-90px)] text-lime-main">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/navigation/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class="btn bg-primary-100 hover:bg-surface-100 hover:text-primary-100 text-surfa
</footer>

<footer
class="flex flex-wrap justify-around w-full p-10 mb-16 text-base border-t footer md:text-xl text-primary-500 bg-surface-200 md:mb-0 border-surface-600">
class="flex flex-wrap justify-around w-full p-10 text-base border-t mb-14 footer md:text-xl text-primary-500 bg-surface-200 md:mb-0 border-surface-600">

<aside class="flex justify-center md:justify-start">
<img src="{{ Vite::asset('resources/images/svg/logo-no-background.svg') }}" class="w-full max-h-44">
Expand Down
10 changes: 0 additions & 10 deletions resources/views/components/navigation/menu-desktop.blade.php

This file was deleted.

58 changes: 0 additions & 58 deletions resources/views/components/navigation/menu-mobile.blade.php

This file was deleted.

29 changes: 0 additions & 29 deletions resources/views/components/navigation/navbar.blade.php

This file was deleted.

Loading

0 comments on commit a26917e

Please sign in to comment.