Skip to content

Commit

Permalink
slight touchups
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhelp committed Oct 24, 2024
1 parent 3463cb9 commit 8d21805
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion apps/web/src/app/settings/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default async function ({ children }: { children: ReactNode }) {
</div>
</div>
<aside className="sticky top-20 hidden h-screen md:block">
{/* <SettingsSection name="Settings" path="/settings" /> */}
<SettingsSection name="Account" path="/settings#account" />
<SettingsSection name="Profile" path="/settings#profile" />
<SettingsSection
Expand Down
23 changes: 10 additions & 13 deletions apps/web/src/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,22 @@ export default async function Page() {
const user = await getUser(userId);
if (!user) return redirect("/sign-in");

function Header({ tag }: { tag: string }) {
return (
<h1
id={tag.toLowerCase()}
className="mt-10 pb-5 text-4xl font-bold"
>
{tag}
</h1>
);
}

return (
<div>
<main>
<Header tag="Account" />
<AccountSettings user={user} />
<Header tag="Profile" />
<ProfileSettings profile={user} />
<Header tag={"Registration"} />
<RegistrationSettings />
</div>
</main>
);
}

function Header({ tag }: { tag: string }) {
return (
<h1 id={tag.toLowerCase()} className="mt-10 pb-5 text-4xl font-bold">
{tag}
</h1>
);
}
1 change: 1 addition & 0 deletions apps/web/src/components/settings/SettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface ToggleItemProps {

export default function SettingsSection({ name, path }: ToggleItemProps) {
const currPath = usePathname();
// NOTE: usepathname hook does not include the fragment part such as #registration or #account so we will need to use the window to access this later
return (
<Link href={path}>
<div
Expand Down

0 comments on commit 8d21805

Please sign in to comment.