Skip to content

Commit 342e30e

Browse files
authored
Merge pull request #91 from CS3219-AY2425S1/ms4-frontend
2 parents ee7a6d8 + ba71de5 commit 342e30e

File tree

89 files changed

+2750
-1186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2750
-1186
lines changed

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
}

frontend/next.config.mjs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
/** @type {import('next').NextConfig} */
22
const nextConfig = {
3-
eslint: {
4-
// Warning: This allows production builds to successfully complete even if
5-
// your project has ESLint errors.
6-
ignoreDuringBuilds: true,
7-
},
8-
93
webpackDevMiddleware: (config) => {
104
config.watchOptions = {
115
poll: 1000,

frontend/package-lock.json

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

frontend/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@hookform/resolvers": "^3.9.0",
1313
"@radix-ui/react-alert-dialog": "^1.1.1",
1414
"@radix-ui/react-avatar": "^1.1.0",
15+
"@radix-ui/react-checkbox": "^1.1.2",
1516
"@radix-ui/react-dialog": "^1.1.1",
1617
"@radix-ui/react-dropdown-menu": "^2.1.1",
1718
"@radix-ui/react-hover-card": "^1.1.1",
@@ -25,6 +26,7 @@
2526
"@radix-ui/react-toast": "^1.2.1",
2627
"@radix-ui/react-tooltip": "^1.1.2",
2728
"@tanstack/react-table": "^8.20.5",
29+
"@uidotdev/usehooks": "^2.4.1",
2830
"class-variance-authority": "^0.7.0",
2931
"clsx": "^2.1.1",
3032
"cmdk": "^1.0.0",
@@ -41,6 +43,7 @@
4143
"socket.io-client": "^4.7.5",
4244
"tailwind-merge": "^2.5.2",
4345
"tailwindcss-animate": "^1.0.7",
46+
"usehooks-ts": "^3.1.0",
4447
"zod": "^3.23.8"
4548
},
4649
"devDependencies": {
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

frontend/src/app/auth/layout.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import Navbar from "@/components/Navbar";
2+
import { Toaster } from "@/components/ui/toaster";
3+
import { ReactNode } from "react";
4+
5+
import { getCurrentUser } from "@/services/userService";
6+
import { redirect } from "next/navigation";
7+
8+
export default async function AuthLayout({
9+
children,
10+
}: {
11+
children: ReactNode;
12+
}) {
13+
const currentUser = await getCurrentUser();
14+
15+
if (currentUser.statusCode === 200 && currentUser.data) {
16+
redirect("/dashboard");
17+
}
18+
19+
return (
20+
<div className="flex flex-col min-h-screen">
21+
<Navbar isMinimal={true} className="relative mt-8 border-b-0" />
22+
<div className="flex-1 max-h-20" />
23+
<main className="flex-1">{children}</main>
24+
<Toaster />
25+
</div>
26+
);
27+
}

0 commit comments

Comments
 (0)