From eeb6b856e697259b16e2e7bf4fad675bf489d51f Mon Sep 17 00:00:00 2001 From: Nicholas Pease Date: Sat, 24 Feb 2024 06:35:23 +0000 Subject: [PATCH] UI Changes, Prepare for Chatrooms --- frontend-next/src/app/api/signout/route.js | 2 +- frontend-next/src/app/app/layout.js | 7 -- frontend-next/src/app/app/page.js | 79 ++++++++++++++++++++-- frontend-next/src/app/app/shared.js | 18 ----- 4 files changed, 74 insertions(+), 32 deletions(-) delete mode 100644 frontend-next/src/app/app/shared.js diff --git a/frontend-next/src/app/api/signout/route.js b/frontend-next/src/app/api/signout/route.js index e33509a..e107f50 100644 --- a/frontend-next/src/app/api/signout/route.js +++ b/frontend-next/src/app/api/signout/route.js @@ -6,5 +6,5 @@ export async function GET(req) { cookies().delete('user') cookies().delete('session') cookies().delete('uid') - return NextResponse.json({}, { status: 200 }); + return NextResponse.redirect(new URL("/",req.url)) } \ No newline at end of file diff --git a/frontend-next/src/app/app/layout.js b/frontend-next/src/app/app/layout.js index 4b40e5e..18a5f84 100644 --- a/frontend-next/src/app/app/layout.js +++ b/frontend-next/src/app/app/layout.js @@ -1,6 +1,5 @@ import { Inter } from "next/font/google"; import "../globals.css"; -import { Header, Sidebar } from "./shared" const inter = Inter({ subsets: ["latin"] }); @@ -13,13 +12,7 @@ export default function RootLayout({ children }) { return ( -
-
-
{children} -
- -
); diff --git a/frontend-next/src/app/app/page.js b/frontend-next/src/app/app/page.js index d3ec30d..4a70000 100644 --- a/frontend-next/src/app/app/page.js +++ b/frontend-next/src/app/app/page.js @@ -1,6 +1,66 @@ "use client" import { useState, useEffect } from 'react' -import {Map, Marker} from "pigeon-maps" +import {Map, Marker, ZoomControl} from "pigeon-maps" + +function Header() { + return ( +
+ +
+ ) +} + +function Sidebar() { + var nearbyTab = false + return ( +
+
+
+
+
{nearbyTab = true}}>Nearby
+
My Rooms
+
Create
+
+
+ {nearbyTab &&
+ + + + + + + + + + + + + + + + + +
} +
+
+ + ) +} + +function ChatRoomSidebar({roomName}) { + + return ( +
+
+ Icons +
+
+
{roomName}
+
x Members
+
+
+ ) +} function WelcomeMessage() { //TODO: REALLY GROSS WAY TO GET COOKIES, NEED NEW WAY TO STORE USER DATA WITHOUT API CALLS. THIS PAGE HAS TO BE CLIENT SIDE DUE TO MAPS / GEOLOCATION @@ -20,7 +80,7 @@ function WelcomeMessage() { return (
- Welcome, {data.firstName} {data.lastName} + Welcome, {data.firstName} {data.lastName} ({data.username})
Lets see what's happening in your area. @@ -47,6 +107,7 @@ function Geo() { return ( + ) } else { @@ -59,11 +120,17 @@ function Geo() { function Home() { return ( -
- -
- +
+
+
+
+ +
+ +
+
+
) } diff --git a/frontend-next/src/app/app/shared.js b/frontend-next/src/app/app/shared.js deleted file mode 100644 index d9021ae..0000000 --- a/frontend-next/src/app/app/shared.js +++ /dev/null @@ -1,18 +0,0 @@ -export function Header() { - return ( -
- -
- ) -} - -export function Sidebar() { - return ( -
-
- Sidebar -
-
- - ) - }