Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into HK-180-no-duplicate-re…
Browse files Browse the repository at this point in the history
…sumes
  • Loading branch information
christianhelp committed Dec 7, 2024
2 parents 6fedfec + 9fce72e commit 9fd5462
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 24 deletions.
21 changes: 13 additions & 8 deletions apps/web/src/app/admin/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ export default async function AdminLayout({ children }: AdminLayoutProps) {
<ClientToast />
<div className="fixed z-20 grid h-16 w-full grid-cols-2 bg-nav px-5">
<div className="flex items-center gap-x-4">
<Image
src={c.icon.svg}
alt={c.hackathonName + " Logo"}
width={32}
height={32}
/>
<div className="h-[45%] w-[2px] rotate-[25deg] bg-muted-foreground" />
<h2 className="font-bold tracking-tight">Admin</h2>
<Link
href={"/"}
className="mr-5 flex items-center gap-x-2"
>
<Image
src={c.icon.svg}
alt={c.hackathonName + " Logo"}
width={32}
height={32}
/>
<div className="h-[45%] w-[2px] rotate-[25deg] bg-muted-foreground" />
<h2 className="font-bold tracking-tight">Admin</h2>
</Link>
</div>
<div className="hidden items-center justify-end gap-x-4 md:flex">
<Link href={"/"}>
Expand Down
9 changes: 5 additions & 4 deletions apps/web/src/components/dash/shared/ProfileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { auth, SignOutButton } from "@clerk/nextjs";
import Link from "next/link";
import { DropdownSwitcher } from "@/components/shared/ThemeSwitcher";
import { getUser } from "db/functions";
import { clientLogOut } from "@/lib/utils/client/shared";

export default async function ProfileButton() {
const clerkUser = auth();
Expand Down Expand Up @@ -68,9 +69,9 @@ export default async function ProfileButton() {
</Link>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<SignOutButton>
<SignOutButton signOutCallback={clientLogOut}>
<DropdownMenuItem className="cursor-pointer hover:!bg-destructive">
Log out
Sign out
</DropdownMenuItem>
</SignOutButton>
</DropdownMenuContent>
Expand Down Expand Up @@ -122,9 +123,9 @@ export default async function ProfileButton() {
</Link>
</DropdownMenuGroup>
<DropdownMenuSeparator />
<SignOutButton>
<SignOutButton signOutCallback={clientLogOut}>
<DropdownMenuItem className="cursor-pointer hover:!bg-destructive">
Log out
Sign out
</DropdownMenuItem>
</SignOutButton>
</DropdownMenuContent>
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/components/landing/MLHBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export default function MLHBadge() {
id="mlh-trust-badge"
className="absolute right-5 top-0 z-50 w-[10%] min-w-[60px] max-w-[100px]"
// style="display:block;max-width:100px;min-width:60px;position:fixed;right:50px;top:0;width:10%;z-index:10000"
href="https://mlh.io/na?utm_source=na-hackathon&utm_medium=TrustBadge&utm_campaign=2024-season&utm_content=black"
href="https://mlh.io/na?utm_source=na-hackathon&utm_medium=TrustBadge&utm_campaign=2025-season&utm_content=black"
target="_blank"
>
<Image
src="https://s3.amazonaws.com/logged-assets/trust-badge/2024/mlh-trust-badge-2024-black.svg"
alt="Major League Hacking 2024 Hackathon Season"
src="https://s3.amazonaws.com/logged-assets/trust-badge/2025/mlh-trust-badge-2025-black.svg"
alt="Major League Hacking 2025 Hackathon Season"
width={0}
height={0}
className="aspect-auto h-auto w-full"
Expand All @@ -27,12 +27,12 @@ export default function MLHBadge() {
id="mlh-trust-badge"
className="absolute right-5 top-0 z-50 w-[10%] min-w-[60px] max-w-[100px]"
// style="display:block;max-width:100px;min-width:60px;position:fixed;right:50px;top:0;width:10%;z-index:10000"
href="https://mlh.io/na?utm_source=na-hackathon&utm_medium=TrustBadge&utm_campaign=2024-season&utm_content=white"
href="https://mlh.io/na?utm_source=na-hackathon&utm_medium=TrustBadge&utm_campaign=2025-season&utm_content=white"
target="_blank"
>
<Image
src="https://s3.amazonaws.com/logged-assets/trust-badge/2024/mlh-trust-badge-2024-white.svg"
alt="Major League Hacking 2024 Hackathon Season"
src="https://s3.amazonaws.com/logged-assets/trust-badge/2025/mlh-trust-badge-2025-white.svg"
alt="Major League Hacking 2025 Hackathon Season"
width={0}
height={0}
className="aspect-auto h-auto w-full"
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/components/shared/ProfileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { DropdownSwitcher } from "@/components/shared/ThemeSwitcher";
import DefaultDropdownTrigger from "../dash/shared/DefaultDropDownTrigger";
import MobileNavBarLinks from "./MobileNavBarLinks";
import { getUser } from "db/functions";
import { redirect } from "next/navigation";
import { clientLogOut } from "@/lib/utils/client/shared";

export default async function ProfileButton() {
const clerkUser = await auth();
Expand Down Expand Up @@ -102,9 +102,9 @@ export default async function ProfileButton() {
</DropdownMenuGroup>
<DropdownMenuSeparator className="bg-[rgb(228,228,231)] dark:bg-[rgb(39,39,42)]" />
<DropdownSwitcher />
<SignOutButton>
<SignOutButton signOutCallback={clientLogOut}>
<DropdownMenuItem className="cursor-pointer hover:!bg-destructive">
Log out
Sign out
</DropdownMenuItem>
</SignOutButton>
</DropdownMenuContent>
Expand Down Expand Up @@ -176,9 +176,9 @@ export default async function ProfileButton() {
</DropdownMenuGroup>
<DropdownMenuSeparator className="bg-[rgb(228,228,231)] dark:bg-[rgb(39,39,42)]" />
<DropdownSwitcher />
<SignOutButton>
<DropdownMenuItem className="cursor-pointer hover:!bg-destructive">
Log out
<SignOutButton signOutCallback={clientLogOut}>
<DropdownMenuItem className="cursor-pointer text-red-500 hover:!bg-destructive hover:text-muted">
Sign out
</DropdownMenuItem>
</SignOutButton>
</DropdownMenuContent>
Expand Down
5 changes: 5 additions & 0 deletions apps/web/src/lib/utils/client/shared.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { redirect } from "next/navigation";
export function getClientTimeZone(vercelIPTimeZone: string | null) {
return vercelIPTimeZone ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
}
export async function clientLogOut(){
"use server";
redirect("/");
};

0 comments on commit 9fd5462

Please sign in to comment.