Skip to content

Commit e22fc47

Browse files
committed
chore: home page ui
1 parent 6787cfa commit e22fc47

12 files changed

Lines changed: 310 additions & 29 deletions

File tree

web/package-lock.json

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525
"ag-grid-react": "^35.1.0",
2626
"class-variance-authority": "^0.7.1",
2727
"clsx": "^2.1.1",
28+
"framer-motion": "^12.34.3",
2829
"lucide-react": "^0.560.0",
2930
"react": "19.2.3",
3031
"react-dom": "19.2.3",
3132
"react-router": "^7.13.0",
33+
"react-use-measure": "^2.1.7",
3234
"tailwindcss-animate": "^1.0.7"
3335
},
3436
"devDependencies": {

web/src/assets/GithubSvg.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export default function GithubSvg() {
2+
return (
3+
<div>
4+
<svg
5+
role="img"
6+
viewBox="0 0 24 24"
7+
xmlns="http://www.w3.org/2000/svg"
8+
fill={"currentColor"}
9+
>
10+
<title>GitHub</title>
11+
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" />
12+
</svg>
13+
</div>
14+
);
15+
}

web/src/assets/huh.gif

924 KB
Loading

web/src/assets/okey-frieren.png

246 KB
Loading

web/src/components/Navbar.tsx

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import type { Session } from "@supabase/supabase-js";
1818
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
1919
import { Spinner } from "./ui/spinner";
2020
import SearchCompany from "./SearchCompany";
21+
import okeyFrieren from "~/assets/okey-frieren.png";
22+
import GithubSvg from "~/assets/githubSvg";
2123

2224
export default function Navbar() {
2325
return (
@@ -27,7 +29,6 @@ export default function Navbar() {
2729
<NavigationMenu>
2830
<NavigationMenuList>
2931
<NavigateLink title="" icon={<House size={20} />} path="/" />
30-
<NavigateDropdown />
3132
<NavigateLink title="All Problems" path="/all-problems" />
3233
</NavigationMenuList>
3334
</NavigationMenu>
@@ -36,6 +37,18 @@ export default function Navbar() {
3637
<MobileNav />
3738

3839
<div className="flex h-full items-center justify-between gap-4">
40+
<Link
41+
to="https://github.com/hitarth-gg/visor-leetcode"
42+
target="_blank"
43+
>
44+
<Button
45+
variant={"ghost"}
46+
size={"icon"}
47+
className="h-8 cursor-pointer"
48+
>
49+
<GithubSvg />
50+
</Button>
51+
</Link>
3952
<ToggleTheme />
4053
<SearchCompany />
4154
<AuthButton />
@@ -80,7 +93,29 @@ function MobileNav() {
8093
document.body.style.overflow = "";
8194
}}
8295
>
83-
<div>Mobile Navigation goes here</div>
96+
<nav className="flex flex-col gap-2 p-4">
97+
<Link
98+
to="/"
99+
className="flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium hover:bg-accent"
100+
onClick={() => {
101+
setMenuOpen(false);
102+
document.body.style.overflow = "";
103+
}}
104+
>
105+
<House size={18} />
106+
Home
107+
</Link>
108+
<Link
109+
to="/all-problems"
110+
className="flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium hover:bg-accent"
111+
onClick={() => {
112+
setMenuOpen(false);
113+
document.body.style.overflow = "";
114+
}}
115+
>
116+
All Problems
117+
</Link>
118+
</nav>
84119
</div>
85120
</>
86121
);
@@ -196,7 +231,7 @@ function ToggleTheme() {
196231
<Button
197232
variant={"ghost"}
198233
size={"icon"}
199-
className="h-8 w-8 p-0"
234+
className="h-8 w-8 cursor-pointer p-0"
200235
onClick={() => {
201236
setTheme(theme === "light" ? "dark" : "light");
202237
}}

web/src/context/ContextProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import type { Theme } from "~/types/shared";
55
export function ContextProvider({ children }: { children: React.ReactNode }) {
66
const [theme, setThemeState] = useState<Theme>(() => {
77
const storedTheme = localStorage.getItem("theme") as Theme | null;
8-
document.body.classList.toggle("dark", storedTheme === "dark");
9-
return storedTheme ?? "light";
8+
document.body.classList.toggle("dark", (storedTheme ?? "dark") === "dark");
9+
return storedTheme ?? "dark";
1010
});
1111
const [otherState, setOtherState] = useState<number>(0);
1212

web/src/pages/AuthCallback.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ export default function AuthCallback() {
3434
}
3535
}
3636

37-
// Check what kind of callback this is via the hash fragment (implicit flow)
38-
// Supabase handles the hash automatically on getSession, so we just need
39-
// to check the current session.
4037
const {
4138
data: { session },
4239
} = await supabase.auth.getSession();
@@ -46,19 +43,6 @@ export default function AuthCallback() {
4643
return;
4744
}
4845

49-
// // Detect password recovery flow — redirect to reset-password page
50-
// if (session.user?.recovery_sent_at) {
51-
// const isRecovery =
52-
// new Date().getTime() -
53-
// new Date(session.user.recovery_sent_at).getTime() <
54-
// 1000 * 60 * 60; // within the last hour
55-
56-
// if (isRecovery) {
57-
// navigate("/reset-password");
58-
// return;
59-
// }
60-
// }
61-
6246
navigate(next);
6347
}
6448

web/src/pages/ErrorPage.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { TriangleAlert, TriangleAlertIcon } from "lucide-react";
1+
import { TriangleAlert } from "lucide-react";
22
import { useRouteError } from "react-router";
33
import CountBtn from "~/components/count-btn";
4+
import huhGif from "~/assets/huh.gif";
45

56
export default function ErrorPage() {
67
const routerError = useRouteError();
@@ -18,6 +19,7 @@ export default function ErrorPage() {
1819
<div className="absolute inset-0 flex items-center justify-center dark:bg-neutral-950">
1920
<div className="bg-card ring-foreground/10 text-card-foreground m-4 rounded-md px-8 py-4 ring-1">
2021
<div className="font-geist flex flex-col items-center gap-2 text-center">
22+
<img src={huhGif} alt="huh" className="mb-2 h-16 rounded-md object-cover" />
2123
<TriangleAlert className="text-foreground" />
2224
<span>Something went wrong!</span>
2325
{status && statusText && (

0 commit comments

Comments
 (0)