Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #17 from Programming-Club-Ahmedabad-University/sty…
Browse files Browse the repository at this point in the history
…le/customized-login-page

successfully migrated to page router...rip app router
  • Loading branch information
JeelRajodiya authored Aug 21, 2023
2 parents deffb18 + 46974c9 commit 1452838
Show file tree
Hide file tree
Showing 19 changed files with 278 additions and 128 deletions.
19 changes: 0 additions & 19 deletions client/app/Test/page.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions client/app/api/auth/[...nextauth]/route.ts

This file was deleted.

39 changes: 0 additions & 39 deletions client/app/components/UserCard/UserCard.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions client/app/providers.tsx

This file was deleted.

18 changes: 16 additions & 2 deletions client/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
webpack(config) {
config.resolve.extensions.push(".ts", ".tsx");
return config;
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "firebasestorage.googleapis.com",
port: "",
},
],
},
};

module.exports = nextConfig
module.exports = nextConfig;
75 changes: 52 additions & 23 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@nextui-org/react": "^2.0.22",
"@nextui-org/react": "^2.0.24",
"@types/node": "20.5.0",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
Expand Down
7 changes: 2 additions & 5 deletions client/app/layout.tsx → client/pages/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "./globals.css";
// import "./globals.css";
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import { Providers } from "./providers";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -17,9 +16,7 @@ export default function RootLayout({
}) {
return (
<html lang="en" className="dark" suppressHydrationWarning={true}>
<body>
<Providers>{children}</Providers>
</body>
<body>{children}</body>
</html>
);
}
19 changes: 19 additions & 0 deletions client/pages/Test/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use client";
import { useEffect, useState } from "react";

export default function Test() {
// const ws = new WebSocket("ws://localhost:3001");
const [data, setData] = useState(null);
// useEffect(() => {
// ws.onmessage = (e) => {
// // a message was received

// setData(e.data);
// };
// return () => {
// ws.close();
// };
// }, []);

return <div>{data}</div>;
}
22 changes: 22 additions & 0 deletions client/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { SessionProvider } from "next-auth/react";

import type { AppProps } from "next/app";
import type { Session } from "next-auth";
import "./globals.css";

import { NextUIProvider } from "@nextui-org/react";

export default function App({
Component,
pageProps: { session, ...pageProps },
}: AppProps<{ session: Session }>) {
return (
<SessionProvider session={session}>
<NextUIProvider>
<main className="dark text-foreground bg-background">
<Component {...pageProps} />
</main>
</NextUIProvider>
</SessionProvider>
);
}
18 changes: 18 additions & 0 deletions client/pages/api/auth/[...nextauth]/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import NextAuth from "next-auth";
import GoogleProvider from "next-auth/providers/google";
if (!process.env.GOOGLE_CLIENT_ID) {
throw Error("GOOGLE_CLIENT_ID is not available in .env");
} else if (!process.env.GOOGLE_CLIENT_SECRET) {
throw Error("GOOGLE_CLIENT_SECRET is not available in .env");
}

const handler = NextAuth({
providers: [
GoogleProvider({
clientId: process.env.GOOGLE_CLIENT_ID!,
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
}),
],
});

export default handler;
Loading

0 comments on commit 1452838

Please sign in to comment.