Connect, collaborate, and grow with a community of TypeScript developers
Update Settings/Profile with Small Changes (#957)
Maxwell DeMaiof69deda499d5
diff --git a/apps/web/src/app/[locale]/[username]/_components/dashboard/index.tsx b/apps/web/src/app/[locale]/[username]/_components/dashboard/index.tsxindex 60c4c867..271413ab 100644--- a/apps/web/src/app/[locale]/[username]/_components/dashboard/index.tsx+++ b/apps/web/src/app/[locale]/[username]/_components/dashboard/index.tsx@@ -77,7 +77,7 @@ export function Dashboard({ user, isOwnProfile, children }: Props) {{/* // TODO: GFI: make each page a subroute, put settings & profile into same layout */}<Tabs className="flex flex-col gap-8 py-8 md:flex-row" value={selectedTab}><VerticalTabsList>- <div className="flex flex-col items-center gap-10 md:items-start">+ <div className="flex flex-col items-center gap-4 md:items-start"><divclassName="h-32 w-32 rounded-3xl bg-cover bg-center bg-no-repeat md:h-64 md:w-64"style={{ backgroundImage: `url(${user.image ?? '/avatar.jpeg'})` }}@@ -85,7 +85,7 @@ export function Dashboard({ user, isOwnProfile, children }: Props) {<div className="flex flex-col items-center gap-2 md:w-full md:items-start"><UserHeader user={user} isOwnProfile={isOwnProfile} /><span- className="text-muted-foreground text-sm italic tracking-tight"+ className="text-muted-foreground tracking-tight"title={`Joined ${user.createdAt.toString()}`}>Joined {getRelativeTime(user.createdAt)}@@ -97,7 +97,7 @@ export function Dashboard({ user, isOwnProfile, children }: Props) {<div className="flex items-center gap-2" key={link.id}><MagicIcon url={link.url} /><a- className="text-xs text-neutral-400 hover:text-neutral-600 dark:text-neutral-600 dark:hover:text-neutral-400"+ className="text-neutral-400 hover:text-neutral-600 dark:text-neutral-600 dark:hover:text-neutral-400"href={link.url}rel="noopener noreferrer"target="_blank"diff --git a/apps/web/src/app/[locale]/settings/_components/edit-profile-tab.tsx b/apps/web/src/app/[locale]/settings/_components/edit-profile-tab.tsxindex a6d90dbb..771bd231 100644--- a/apps/web/src/app/[locale]/settings/_components/edit-profile-tab.tsx+++ b/apps/web/src/app/[locale]/settings/_components/edit-profile-tab.tsx@@ -31,9 +31,10 @@ function ProfileForm({ user }: Props) {const { toast } = useToast();// NOTE: make the user links have 4 at all times+ const userLinksLength: number = user.userLinks?.length ?? 0;const userLinks = (user.userLinks = [...user.userLinks,- ...Array(4 - user.userLinks.length).fill({+ ...Array(4 - userLinksLength).fill({id: null,url: '',}),diff --git a/apps/web/src/app/[locale]/settings/_components/settings.tsx b/apps/web/src/app/[locale]/settings/_components/settings.tsxindex af413604..772c9a9c 100644--- a/apps/web/src/app/[locale]/settings/_components/settings.tsx+++ b/apps/web/src/app/[locale]/settings/_components/settings.tsx@@ -32,37 +32,14 @@ export const Settings = async ({ user }: Props) => {{/* // TODO: GFI: make each page a subroute, put settings & profile into the same layout */}<Tabs className="flex flex-col gap-8 py-8 md:flex-row" defaultValue="settings"><VerticalTabsList>- <div className="flex flex-col items-center gap-10 md:items-start">+ <div className="flex flex-col items-center gap-4 md:items-start"><divclassName="h-32 w-32 rounded-3xl bg-cover bg-center bg-no-repeat md:h-64 md:w-64"style={{ backgroundImage: `url(${user.image ?? '/avatar.jpeg'})` }}/><div className="flex flex-col items-center gap-2 md:w-full md:items-start"><UserHeader user={user} isOwnProfile />- <span- className="text-muted-foreground text-sm italic tracking-tight"- title={`Joined ${user.createdAt.toString()}`}- >- Joined {getRelativeTime(user.createdAt)}- </span></div>- {Boolean(filteredProfileLinks.length > 0) && (- <div className="flex w-full flex-col items-center gap-2 md:items-start">- {filteredProfileLinks.map((link) => (- <div className="flex items-center gap-2" key={link.id}>- <MagicIcon url={link.url} />- <a- className="text-xs text-neutral-400 hover:text-neutral-600 dark:text-neutral-600 dark:hover:text-neutral-400"- href={link.url}- rel="noopener noreferrer"- target="_blank"- >- {stripProtocolAndWWW(link.url)}- </a>- </div>- ))}- </div>- )}<div className="flex gap-4 md:w-full md:flex-col"><VerticalTabsTriggerclassName="flex items-center justify-center gap-3 px-2 hover:bg-neutral-200/50 dark:hover:bg-neutral-700/50 md:justify-normal md:px-3 "