From d692e86fe0eff1ff09fad4038d80fbd1e43c6303 Mon Sep 17 00:00:00 2001 From: Face <69168154+face-hh@users.noreply.github.com> Date: Sun, 25 May 2025 18:44:06 +0300 Subject: [PATCH] feat: profile page + 404 page + refactor code --- .../lib/components/self/CommentSection.svelte | 38 +- .../src/lib/components/self/DataTable.svelte | 153 ++++++ .../lib/components/self/ProfileBadges.svelte | 26 + .../lib/components/self/SilentBadge.svelte | 25 + .../components/self/UserProfilePreview.svelte | 134 ++++++ website/src/lib/types/comment.ts | 1 + website/src/lib/types/user-profile.ts | 56 +++ website/src/lib/utils.ts | 14 +- website/src/routes/+error.svelte | 48 ++ website/src/routes/+page.svelte | 91 ++-- .../api/coin/[coinSymbol]/comments/+server.ts | 4 - .../src/routes/api/user/[userId]/+server.ts | 139 ++++++ .../src/routes/coin/[coinSymbol]/+page.svelte | 39 +- website/src/routes/leaderboard/+page.svelte | 372 +++++++-------- .../src/routes/user/[username]/+page.svelte | 450 ++++++++++++++++++ website/src/routes/user/[username]/+page.ts | 5 + website/static/404.gif | Bin 0 -> 604228 bytes 17 files changed, 1282 insertions(+), 313 deletions(-) create mode 100644 website/src/lib/components/self/DataTable.svelte create mode 100644 website/src/lib/components/self/ProfileBadges.svelte create mode 100644 website/src/lib/components/self/SilentBadge.svelte create mode 100644 website/src/lib/components/self/UserProfilePreview.svelte create mode 100644 website/src/lib/types/user-profile.ts create mode 100644 website/src/routes/+error.svelte create mode 100644 website/src/routes/api/user/[userId]/+server.ts create mode 100644 website/src/routes/user/[username]/+page.svelte create mode 100644 website/src/routes/user/[username]/+page.ts create mode 100644 website/static/404.gif diff --git a/website/src/lib/components/self/CommentSection.svelte b/website/src/lib/components/self/CommentSection.svelte index 8cef634..d2c8327 100644 --- a/website/src/lib/components/self/CommentSection.svelte +++ b/website/src/lib/components/self/CommentSection.svelte @@ -5,12 +5,13 @@ import * as Avatar from '$lib/components/ui/avatar'; import * as HoverCard from '$lib/components/ui/hover-card'; import { Badge } from '$lib/components/ui/badge'; - import { MessageCircle, Send, Loader2, Heart, CalendarDays } from 'lucide-svelte'; + import { MessageCircle, Send, Loader2, Heart } from 'lucide-svelte'; import { USER_DATA } from '$lib/stores/user-data'; import { toast } from 'svelte-sonner'; import { goto } from '$app/navigation'; import { formatTimeAgo, getPublicUrl } from '$lib/utils'; import SignInConfirmDialog from '$lib/components/self/SignInConfirmDialog.svelte'; + import UserProfilePreview from '$lib/components/self/UserProfilePreview.svelte'; import WebSocket, { type WebSocketHandle } from '$lib/components/self/WebSocket.svelte'; const { coinSymbol } = $props<{ coinSymbol: string }>(); @@ -221,7 +222,7 @@ {#each comments as comment (comment.id)}
@{coin.creatorUsername}
- {#if coin.creatorBio} -{coin.creatorBio}
- {/if} -No major profits recorded today
-{user.name}
-@{user.username}
-- No major losses recorded today -
-{user.name}
-@{user.username}
-Everyone's invested! 💸
-{user.name}
-@{user.username}
-No large portfolios yet! 📉
-{user.name}
-@{user.username}
-@{profileData.profile.username}
++ {profileData.profile.bio} +
+ {/if} + +{profileData.stats.holdingsCount} holdings
+Available cash
+Coin holdings
+S5gGF|kTA3-h;AizYXdZfHMU~oWO!)!KDIEy}n?SYQ#!zk&S=5^&
z$ov)@N7mGm%Q&Z;Q%gxIF$djqG}hQsN~qLQ4l%}H2Mr`c)#Aq}8l>?=6XTHwVT9~8
z>12fPNjW8zRX%v7efZ_qAD3MQ_$7g1ib?<2ftGc}V1sF{WhI+zK?&i6N+yX#EzKko
z+lB%iq!6Fc*y9XujtDxaBe$TU5sJwu1EUOjgu+TUe*p4_q?OKSBc{>iSWYfI{utye
z%J@+S6yhma9;!?}3FT<5vifG5vC2B@np58Q!j@g?x*wRmj`^!%WLAM-1jQOlES9t?
zs}`)rx(5}7NsdB{p4A?dP@jHYQwkg0F4Zl#*yN(iEGXupj54RZln5&%okZ!SnaYb(
zO0%3Yi!9aL8B~zDAma!ObDEl}s;j>0>cQ!mH6g BK^rk3L2>DBeBB_JP^UK>}rd_1|4*(t_US0
zjKT`@^6Rg&0-I1S!x9v%K&=+jAeYA?o2;_SGV5$67X1KCG)eI3MW57GW6d>o_K_|B
zxY}}qPq+8D=q8XU*bo96FRpN65$K#S#FpjO_`(V32yz02PqgX8qv^2ovbtPq0VbGa
zyt`$cJ*Z=8jgjye>Adt*%0r1K-UBi|`s%}vPyPJdk3au>Y5*1i2|N_h4;5YXs|+7}
z6jHM|oHQ;AEw#{5NkK#gnYcLpw9^eg3{gZ5$RN?gP<)%^3KcaA@|Y?7Fb0!aGr8s(
z8&`9!HGX!K4bNa(eCfSkxCkT-LsoEN%aj%wf{rKf$U+b pwy$h0&