diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 44ed392fa68c67cf17f6b9a16e666b4cc4fe91c7..2c98f3718504a70690ecf0d7139d616ae02f9321 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -5,16 +5,20 @@ import { Login, Signup } from "./auth"; import { Board } from "./board"; import { Header, Body } from "./home"; import Posting from "./post/posting"; +import Layout from "./commons/layout"; + export const App = () => { return ( - } /> - } /> - }> - } /> - } /> - } /> + }> + } /> + } /> + }> + } /> + } /> + } /> + diff --git a/frontend/src/commons/layout.tsx b/frontend/src/commons/layout.tsx new file mode 100644 index 0000000000000000000000000000000000000000..29bcf7482b8e2d0bdf6203052e574936aedefcc0 --- /dev/null +++ b/frontend/src/commons/layout.tsx @@ -0,0 +1,11 @@ +import React, { ReactNode } from "react"; +import { Outlet } from "react-router-dom"; +import { AuthProvider } from "../auth/auth.context"; + +export default function Layout() { + return ( + + + + ); +} diff --git a/frontend/src/home/body.tsx b/frontend/src/home/body.tsx index 73c68cf2c61f9c12030a17134937b8210057cda4..7399ef110c39459e3660940d2b3214d83f635dc5 100644 --- a/frontend/src/home/body.tsx +++ b/frontend/src/home/body.tsx @@ -3,7 +3,7 @@ import { Outlet, useSearchParams } from "react-router-dom"; import Theme from "./theme"; import Citylist from "../Pages/citylist"; import { getPicure } from "../Pages/pic"; -import { PaginationLeft ,PaginationRight} from "../Pages/picpagination"; +import { PaginationLeft, PaginationRight } from "../Pages/picpagination"; const initSearchParams = { theme: "", city: "" }; @@ -48,45 +48,66 @@ export default function Body() { ); }); - const pre = () =>{ - setSelected(selected -1) - }; + const pre = () => { + setSelected(selected - 1); + }; - const next = () =>{ - setSelected(selected + 1) - }; + const next = () => { + setSelected(selected + 1); + }; return ( -
+
-
+
- - + +
-
+
-
- - - +
+ + +
- +
// Body Page ); } -{/*
*/} - {/* {Idpics.slice(offset, offset + limit).map((pic, index: number) => ( +{ + /*
*/ +} +{ + /* {Idpics.slice(offset, offset + limit).map((pic, index: number) => (

{pic.name}

- ))} */} - {/* */} - {/* */} \ No newline at end of file + ))} */ +} +{ + /* */ +} +{ + /* */ +} diff --git a/frontend/src/home/header.tsx b/frontend/src/home/header.tsx index 651b2d6b5ea29f250dd33bb43b58e8c84c041f0e..eb5c368a26bc7625fea1ec5b7b73c7bb7293ffb5 100644 --- a/frontend/src/home/header.tsx +++ b/frontend/src/home/header.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useReducer, useState } from "react"; import { Link, Outlet } from "react-router-dom"; import { useAuth } from "../auth/auth.context"; @@ -8,56 +8,51 @@ export default function Header() { const { logout } = useAuth(); return (
-
- -
-
- {localStorage.getItem("survey-user-info") ? ( - - ) : ( - - )} -
- + +
+ {useAuth().user.isLoggedIn ? ( + -
- -
+ 로그아웃 + + ) : ( + + )}
+
+
); diff --git a/frontend/src/home/theme.tsx b/frontend/src/home/theme.tsx index 13c873ea20909938cfdbda710d03ba93d8415b32..bb44e7ada6a1243a4b62db1c7759f3f981bdaf87 100644 --- a/frontend/src/home/theme.tsx +++ b/frontend/src/home/theme.tsx @@ -1,24 +1,89 @@ -import React, { useEffect, MouseEvent, MouseEventHandler } from "react"; -import { Outlet, useSearchParams } from "react-router-dom"; +import React, { MouseEventHandler } from "react"; type ThemeProps = { handleClick: MouseEventHandler; -} +}; -export default function Theme({handleClick}: ThemeProps) { +export default function Theme({ handleClick }: ThemeProps) { return ( -
- - - - - - - - - - - +
+ + + + + + + + + + +
); -}; \ No newline at end of file +} diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index ff73a6da61cd6e4b302daf7e05ea817a623f7e5b..c299b670186be3c1eb5815c1f833bdbf657b1bf8 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -8,8 +8,8 @@ const root = createRoot(container!); root.render( - - - + {/* */} + + {/* */} ); diff --git a/frontend/src/pages/citylist.tsx b/frontend/src/pages/citylist.tsx index 911d03aaba07331ae2ce579dcdff2ba539eb2b8d..4e29e1b0a90ffc62fe7709beb4fbe64972633c8f 100644 --- a/frontend/src/pages/citylist.tsx +++ b/frontend/src/pages/citylist.tsx @@ -1,24 +1,85 @@ -import React, { MouseEventHandler } from "react"; - +import React, { MouseEventHandler } from "react"; type CityProps = { handleClick: MouseEventHandler; -} +}; -export default function Citylist({handleClick}: CityProps) { +export default function Citylist({ handleClick }: CityProps) { return ( -
- - - - - - - - - - +
+
도시
+ + + + + + + + + + {/* citylist */} -
// Citylist Page +
+ // Citylist Page ); -}; \ No newline at end of file +} diff --git a/src/models/user.model.ts b/src/models/user.model.ts index 5fe10cd08f3341e81e58c0bff1da30b68b5789b7..84cde5ba7085311ea14be3543d0b5c893aabef3d 100644 --- a/src/models/user.model.ts +++ b/src/models/user.model.ts @@ -17,7 +17,7 @@ const schema = new Schema( email: { type: String, //mongoose type인 String으로 일반적인 string과는 겉으로는 대문자 차이 rquired: true, - .: true, + unique: true, validate: [validateEmail, "이메일을 입력해주세요"], }, name: { type: String },