From 85015023bbac9f432fa94efc8faf2f5d19d41d29 Mon Sep 17 00:00:00 2001 From: Javier Daniel Garcia Date: Mon, 23 Oct 2023 14:31:29 -0400 Subject: [PATCH] added navbar and search page ui --- client/src/components/Layout.tsx | 15 +++++++++++ client/src/components/Navbar.tsx | 24 +++++++++++++++++ client/src/components/Root.tsx | 7 ++++- client/src/components/Search.tsx | 42 ++++++++++++++++++++++++++++-- client/src/components/UserCard.tsx | 36 +++++++++++++++++++++++++ 5 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 client/src/components/Layout.tsx create mode 100644 client/src/components/Navbar.tsx create mode 100644 client/src/components/UserCard.tsx diff --git a/client/src/components/Layout.tsx b/client/src/components/Layout.tsx new file mode 100644 index 0000000..77ddefe --- /dev/null +++ b/client/src/components/Layout.tsx @@ -0,0 +1,15 @@ +import { ReactNode } from "react"; +import Navbar from "./Navbar"; + +interface Props { + children: ReactNode; +} + +export default function Layout({ children }: Props) { + return ( +
+ + {children} +
+ ); +} diff --git a/client/src/components/Navbar.tsx b/client/src/components/Navbar.tsx new file mode 100644 index 0000000..8ba6982 --- /dev/null +++ b/client/src/components/Navbar.tsx @@ -0,0 +1,24 @@ +import { Box, Text, Flex } from "@chakra-ui/react"; +import { Link } from "react-router-dom"; +import { useLocation } from "react-router-dom"; + +export default function Navbar() { + const location = useLocation(); + + return ( + + + + + Search + + + + + Profile + + + + + ); +} diff --git a/client/src/components/Root.tsx b/client/src/components/Root.tsx index b99c3e5..2998321 100644 --- a/client/src/components/Root.tsx +++ b/client/src/components/Root.tsx @@ -4,6 +4,7 @@ import { Box, CircularProgress } from "@chakra-ui/react"; import { userProfileSchema } from "../schemas.ts"; import { useProfileStore } from "../store.ts"; import { getToken } from "../token.ts"; +import Layout from "./Layout.tsx"; export const loader = () => defer({ response: handleImplicitLogin() }); @@ -39,7 +40,11 @@ const Root = () => { } > }> - {() => } + {() => ( + + + + )} ); diff --git a/client/src/components/Search.tsx b/client/src/components/Search.tsx index bdaa3a2..efba51b 100644 --- a/client/src/components/Search.tsx +++ b/client/src/components/Search.tsx @@ -1,5 +1,43 @@ -import { Text } from "@chakra-ui/react"; +import { Box, HStack, FormControl, FormLabel, Input, Button } from "@chakra-ui/react"; +import { useState } from "react"; +import UserCard from "./UserCard"; export default function Search() { - return Search; + const [budget, setBudget] = useState(""); + const [cleanliness, setCleanliness] = useState(""); + const [loudness, setLoudness] = useState(""); + const [coed, setCoed] = useState(""); + + return ( + + + + Budget + setBudget(event.target.value)} /> + + + Cleanliness + setCleanliness(event.target.value)} + /> + + + Loudness + setLoudness(event.target.value)} /> + + + Co-Ed + setCoed(event.target.value)} /> + + + + + + + + ); } diff --git a/client/src/components/UserCard.tsx b/client/src/components/UserCard.tsx new file mode 100644 index 0000000..946281e --- /dev/null +++ b/client/src/components/UserCard.tsx @@ -0,0 +1,36 @@ +import { Card, Image, Stack, CardBody, Heading, Text, Box, Button } from "@chakra-ui/react"; + +export default function UserCard() { + return ( + + + Caffe Latte + + + + + First Name Last Name + Gender: + About: + Preferences: + + + + + + ); +}