Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: profile component #282

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions resources/views/components/profile.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
@props([
'user',
'buttons',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think you can pass html as a prop? and that this rather should be a named slot. but correct me if i'm wrong!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolut inte säker?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

om du har testat och det funkar så är det lugnt men vill veta att det funkar innan vi mergar detta

'stats' => [
'lists' => 0,
'reviews' => 0,
'friends' => 0,
],
])

<div class="relative flex w-full">
<div class="absolute top-0 right-0">
<x-lucide-ellipsis-vertical class="h-6 w-6 text-slate-50" />
dcbwe marked this conversation as resolved.
Show resolved Hide resolved
</div>

<div class="mr-6 flex w-full flex-row flex-wrap items-center gap-4">
ell-ska marked this conversation as resolved.
Show resolved Hide resolved
<div class="flex size-30 flex-none items-center justify-center">
@isset($user)
<x-avatar :image="$user->image" size="lg" />
@else
<x-avatar size="lg" />
@endisset
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think there needs to be a wrapping div for the avatar. there's also no need to check if there is a $user because this will never be used where there potentially isn't a user. x-avatar handles if the user doesn't have a profile picture

Suggested change
<div class="flex size-30 flex-none items-center justify-center">
@isset($user)
<x-avatar :image="$user->image" size="lg" />
@else
<x-avatar size="lg" />
@endisset
</div>
<x-avatar :image="$user->image" size="lg" />

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Är wrapper onödig tar vi bort den. Check finns för att inte krasha i test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vilka test? denna komponent används bara på profilsidan och man kan inte gå in på en profil som inte existerar. då kommer man komma till 404 innan denna sida renderar

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixad


<div class="flex grow flex-col gap-3 pr-10 text-slate-50">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is pr-10 needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

följer figmas design, kan tas bort

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finns ingen padding på denna div i figma?

<div class="text-lg font-bold">
@isset($user)
{{ $user->username }}
@else
@username
@endisset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@isset($user)
{{ $user->username }}
@else
@username
@endisset
{{ $user->username }}

same reason as above

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

samma som ovan, kan tas bort

</div>
<div class="flex flex-row gap-6 text-slate-50">
dcbwe marked this conversation as resolved.
Show resolved Hide resolved
@foreach ($stats as $stat => $sum)
<div class="flex flex-col">
<p class="text-sm font-bold">
{{ $sum }}
</p>
<span class="text-sm font-normal">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<span class="text-sm font-normal">
<span class="text-sm font-normal text-slate-200">

{{ $stat }}
</span>
</div>
@endforeach
</div>
</div>

<div class="flex flex-none flex-row gap-2 self-start">
ell-ska marked this conversation as resolved.
Show resolved Hide resolved
@isset($buttons)
{{ $buttons }}
@endisset
</div>
</div>
</div>
Empty file modified resources/views/profile.blade.php
100644 → 100755
ell-ska marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, please don't remove the layout

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

du har raderat allt innehåll i denna fil. det ska vara där

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

den här filen finns det nu innehåll i i main. jag vet inte varför du inte får en merge konflikt men se till att du inte tar bort det som ligger i main innan denna mergas

Empty file.