From affb0d11f7245b9000c05559593ab14a8d0d4291 Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Tue, 10 Sep 2024 13:31:59 -0400 Subject: [PATCH] add sections bar to profile page mods and about sections WIP. Also adjusted user-stack tooltip position slightly --- app/Livewire/User/Profile.php | 10 +++- resources/views/livewire/user-stack.blade.php | 5 +- .../views/livewire/user/profile.blade.php | 55 ++++++++++++++++++- 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/app/Livewire/User/Profile.php b/app/Livewire/User/Profile.php index d3a294c..96cf616 100644 --- a/app/Livewire/User/Profile.php +++ b/app/Livewire/User/Profile.php @@ -3,12 +3,16 @@ namespace App\Livewire\User; use App\Models\User; +use Livewire\Attributes\Url; use Livewire\Component; class Profile extends Component { public User $user; + #[Url] + public string $section = 'wall'; + public $followers; public $following; @@ -23,9 +27,13 @@ class Profile extends Component return view('livewire.user.profile'); } + public function setSection(string $name) { + $this->section = $name; + } + public function message() { - $this->render(); + // todo: not implemented yet } public function followUser(User $user) diff --git a/resources/views/livewire/user-stack.blade.php b/resources/views/livewire/user-stack.blade.php index 8bbb0c0..5c17e47 100644 --- a/resources/views/livewire/user-stack.blade.php +++ b/resources/views/livewire/user-stack.blade.php @@ -10,8 +10,9 @@ {{$user->name[0]}} + {{-- tooltip --}}
+ class="absolute bottom-full -ml-3 left-1/2 transform -translate-x-1/2 mb-2 w-max px-2 py-1 text-sm text-white bg-gray-700 rounded shadow-lg opacity-0 group-hover:opacity-100"> {{$user->name}}
@@ -21,7 +22,7 @@ +{{$users->count()-$limit}}
+ class="absolute bottom-full -ml-3 left-1/2 transform -translate-x-1/2 mb-2 w-max px-2 py-1 text-sm text-white bg-gray-700 rounded shadow-lg opacity-0 group-hover:opacity-100"> {{$users->count()}} total
diff --git a/resources/views/livewire/user/profile.blade.php b/resources/views/livewire/user/profile.blade.php index c6445e2..f4779e8 100644 --- a/resources/views/livewire/user/profile.blade.php +++ b/resources/views/livewire/user/profile.blade.php @@ -68,7 +68,60 @@
- {{-- column 1 placeholder --}} +
+ {{-- Mobile Dropdown --}} +
+ + +
+ + {{-- Desktop Tabs --}} + +
+
+ @switch($section) + @case('wall') +

This is the wall. I don't think this can be implemented yet? requires comments or something

+ @break + @case('mods') +
+ @foreach($user->mods as $mod) + + @endforeach +
+ @break + @case('recentActivity') +

This is the recent activity. Probably need to implement some kind of activity tracking for this?

+ @break + @case('aboutMe') +

{{$user->about}}

+ @break + @endswitch +