Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
51 changes: 27 additions & 24 deletions components/navigation/NavbarMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,33 @@ export function NavbarMobile({ user }: NavbarMobileProps) {
</Button>
</div>
<div className="flex items-center gap-4 mb-4">
<Link href="/profile" className="flex items-center gap-2">
<UserAvatar
picture={
user.user_metadata.avatar_url ||
user.user_metadata.picture
}
fullName={
user.user_metadata.username ||
user.user_metadata.full_name
}
email={user.user_metadata.email}
size={64}
className="rounded-full object-cover"
loading="eager"
/>
<div>
<p className="text-sm font-medium text-text">
{ user.user_metadata.full_name ||
t.common.user}
</p>
<p className="text-xs text-muted">
@{user.user_metadata.username || ''}
</p>
</div>
<Link
href="/profile"
className="flex items-center gap-2"
>
<UserAvatar
picture={
user.user_metadata.avatar_url ||
user.user_metadata.picture
}
fullName={
user.user_metadata.username ||
user.user_metadata.full_name
}
email={user.user_metadata.email}
size={64}
className="rounded-full object-cover"
loading="eager"
/>
<div>
<p className="text-sm font-medium text-text">
{user.user_metadata.full_name ||
t.common.user}
</p>
<p className="text-xs text-muted">
@{user.user_metadata.username || ''}
</p>
</div>
</Link>
</div>

Expand Down
5 changes: 4 additions & 1 deletion components/profile/ProfileTabsSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export function ProfileTabsSkeleton() {
<div>
<div className="flex gap-1 border-b border-border-subtle mb-6 overflow-x-auto pb-px">
{Array.from({ length: 5 }).map((_, i) => (
<Skeleton key={i} className="h-9 w-20 shrink-0 rounded-none rounded-t" />
<Skeleton
key={i}
className="h-9 w-20 shrink-0 rounded-none rounded-t"
/>
))}
</div>
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4">
Expand Down
4 changes: 1 addition & 3 deletions components/search/SearchDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ export function SearchDropdown({
aria-selected={isActive}
href={`/profile/${user.username}`}
onClick={onClose}
onMouseEnter={() =>
onActiveChange?.(index)
}
onMouseEnter={() => onActiveChange?.(index)}
className={cn(
'flex items-center gap-4 p-2 rounded-xl transition-all duration-(--duration-fast) ease-apple group focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60 focus-visible:ring-offset-1 focus-visible:ring-offset-background',
isActive
Expand Down
9 changes: 7 additions & 2 deletions components/settings/ProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,14 @@ export function ProfileSettings({ user }: ProfileSettingsProps) {
}
);
}}
loading={isAvatarPending}
loading={
isAvatarPending
}
>
{t.settings.profile.updateAvatar}
{
t.settings.profile
.updateAvatar
}
</Button>
{avatarState.error && (
<p
Expand Down
8 changes: 6 additions & 2 deletions components/shared/PWAInstallPrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export function PWAInstallPrompt() {
'fixed left-0 right-0 z-40',
'top-[calc(4rem+env(safe-area-inset-top))]',
'transition-transform duration-(--duration-slow) ease-apple',
visible ? 'translate-y-0' : '-translate-y-[200%] pointer-events-none'
visible
? 'translate-y-0'
: '-translate-y-[200%] pointer-events-none'
)}
>
<div className="mx-auto max-w-lg bg-surface/95 backdrop-blur-xl border-b border-border/60 px-4 py-3 flex items-center gap-3">
Expand All @@ -50,7 +52,9 @@ export function PWAInstallPrompt() {
<Share className="size-3" aria-hidden />
{t.pwa.iosShare}
</span>
<span className="text-xs text-muted">{t.pwa.iosThen}</span>
<span className="text-xs text-muted">
{t.pwa.iosThen}
</span>
<span className="inline-flex items-center gap-1 bg-surface-2 border border-border-subtle rounded-md px-1.5 py-0.5 text-xs text-text shrink-0">
<SquarePlus className="size-3" aria-hidden />
{t.pwa.iosAdd}
Expand Down
13 changes: 10 additions & 3 deletions hooks/usePWAInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ function detectIOS(): boolean {
}

function isMobile(): boolean {
return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent) ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
return (
/Android|iPhone|iPad|iPod/i.test(navigator.userAgent) ||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)
);
}

export function usePWAInstall() {
Expand Down Expand Up @@ -91,5 +93,10 @@ export function usePWAInstall() {
}
}

return { visible: state.visible, isIOS: state.isIOS, dismiss, triggerInstall };
return {
visible: state.visible,
isIOS: state.isIOS,
dismiss,
triggerInstall,
};
}
Loading