fix: profile date, avatar system, UserRead schema
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
Some checks failed
Deploy Fediversion / deploy (push) Failing after 1s
This commit is contained in:
parent
d20cc75085
commit
a87c0cc8a3
2 changed files with 11 additions and 6 deletions
|
|
@ -18,6 +18,9 @@ class UserRead(SQLModel):
|
|||
profile_public: bool = True
|
||||
show_attendance_public: bool = True
|
||||
appear_in_leaderboards: bool = True
|
||||
bio: Optional[str] = None
|
||||
username: Optional[str] = None
|
||||
joined_at: Optional[datetime] = None
|
||||
|
||||
class Token(SQLModel):
|
||||
access_token: str
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ interface UserProfile {
|
|||
email: string
|
||||
username: string | null
|
||||
bio: string | null
|
||||
created_at: string
|
||||
joined_at: string | null
|
||||
}
|
||||
|
||||
interface UserBadge {
|
||||
|
|
@ -97,16 +97,18 @@ export default function PublicProfilePage({ params }: { params: Promise<{ slug:
|
|||
|
||||
<Card className="border-0 shadow-none bg-transparent">
|
||||
<div className="flex flex-col md:flex-row gap-8 items-start">
|
||||
<Avatar className="h-32 w-32 border-4 border-background shadow-lg">
|
||||
<AvatarImage src={`https://api.dicebear.com/7.x/notionists/svg?seed=${user.id}`} />
|
||||
<AvatarFallback><User className="h-12 w-12" /></AvatarFallback>
|
||||
</Avatar>
|
||||
<div
|
||||
className="h-32 w-32 rounded-full border-4 border-background shadow-lg flex items-center justify-center text-white text-4xl font-bold"
|
||||
style={{ backgroundColor: (user as any).avatar_bg_color || '#3B82F6' }}
|
||||
>
|
||||
{(user as any).avatar_text || displayName.substring(0, 2).toUpperCase()}
|
||||
</div>
|
||||
<div className="space-y-4 flex-1">
|
||||
<div>
|
||||
<h1 className="text-4xl font-bold tracking-tight">{displayName}</h1>
|
||||
<p className="text-muted-foreground flex items-center gap-2 mt-2">
|
||||
<Calendar className="h-4 w-4" />
|
||||
Member since {new Date(user.created_at).toLocaleDateString()}
|
||||
Member since {user.joined_at ? new Date(user.joined_at).toLocaleDateString() : 'Unknown'}
|
||||
</p>
|
||||
</div>
|
||||
{user.bio && (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue