Commit e1518a1d authored by Lee Soobeom's avatar Lee Soobeom
Browse files

Merge remote-tracking branch 'origin/mk10' into develop

parents 208862f5 2c267d4b
...@@ -5,30 +5,17 @@ import { Login, Signup } from "./auth"; ...@@ -5,30 +5,17 @@ import { Login, Signup } from "./auth";
import { Board } from "./board"; import { Board } from "./board";
import { Header, Body } from "./home"; import { Header, Body } from "./home";
import Posting from "./post/posting"; import Posting from "./post/posting";
import { AuthProvider } from "./auth/auth.context";
import Layout from "./commons/layout";
export const App = () => { export const App = () => {
return ( return (
<BrowserRouter> <BrowserRouter>
<Routes> <Routes>
{/* <Route element={<Layout children={} />}> */} <Route path="login" element={<Login />} />
<Route
path="login"
element={
<AuthProvider>
<Login />
</AuthProvider>
}
/>
<Route path="signup" element={<Signup />} /> <Route path="signup" element={<Signup />} />
<Route path="/" element={<Header />}> <Route path="/" element={<Header />}>
<Route index element={<Body />} /> <Route index element={<Body />} />
<Route path="board" element={<Board />} /> <Route path="board" element={<Board />} />
<Route path="posting" element={<Posting />} /> <Route path="posting" element={<Posting />} />
</Route> </Route>
{/* </Route> */}
</Routes> </Routes>
</BrowserRouter> </BrowserRouter>
); );
......
...@@ -54,14 +54,14 @@ export default function Login() { ...@@ -54,14 +54,14 @@ export default function Login() {
<div className="bg-white w-1/2 md:w-1/3 my-8 text-center text-2xl"> <div className="bg-white w-1/2 md:w-1/3 my-8 text-center text-2xl">
<Link to="/">Travel Report</Link> <Link to="/">Travel Report</Link>
</div> </div>
<div className="flex flex-col w-full md:w-1/2 p-8 md:p-4 md:p-0"> <div className="flex flex-col w-full md:w-1/3 p-8 md:p-4 md:p-0">
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
<div className="flex flex-col md:flex-row border-2 border-black rounded-xl p-8 md:p-12 gap-y-4 md:gap-x-6"> <div className="flex flex-col md:flex-row border-2 border-black rounded-xl p-8 md:p-12 gap-y-4 md:gap-x-6">
<div className="flex flex-col md:w-2/3 md:gap-2 "> <div className="flex flex-col md:w-2/3 md:gap-2 ">
<input <input
className="placeholder:text-slate-300 className="placeholder:text-slate-300
bg-white border border-slate-500 md:rounded-2xl bg-white border border-slate-500 md:rounded-2xl
py-3 md:py-2 pl-9 pr-3 my-2 py-3 md:py-2 pl-9 pr-3
focus:border-black focus:border-black
" "
placeholder="이메일" placeholder="이메일"
......
import React, { ReactNode } from "react";
import { AuthProvider } from "../auth/auth.context";
export default function Layout({ children }: { children: ReactNode }) {
return <AuthProvider>{children}</AuthProvider>;
}
...@@ -15,13 +15,8 @@ export default function Header() { ...@@ -15,13 +15,8 @@ export default function Header() {
</Link> </Link>
</button> </button>
<div className="flex flex-row-reverse"> <div className="flex flex-row-reverse">
<button className="px-5 py-2 bg-teal-400 rounded"> <div className="px-5 py-2 bg-teal-400 rounded">
<Link {localStorage.getItem("survey-user-info") ? (
to="/login"
className="hover:bg-teal-100 focus:text-purple-500 "
>
Login
</Link>
<button <button
onClick={() => { onClick={() => {
logout(); logout();
...@@ -29,7 +24,13 @@ export default function Header() { ...@@ -29,7 +24,13 @@ export default function Header() {
> >
Logout Logout
</button> </button>
) : (
<button>
<Link to="/login">Login</Link>
</button> </button>
)}
</div>
<button className="px-5 py-2 bg-purple-400 rounded"> <button className="px-5 py-2 bg-purple-400 rounded">
<Link <Link
to="/board" to="/board"
......
import React from "react"; import React from "react";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
import { App } from "./App"; import { App } from "./App";
import { AuthProvider } from "./auth/auth.context";
const container = document.getElementById("root"); const container = document.getElementById("root");
const root = createRoot(container!); const root = createRoot(container!);
root.render( root.render(
<React.StrictMode> <React.StrictMode>
<AuthProvider>
<App /> <App />
</AuthProvider>
</React.StrictMode> </React.StrictMode>
); );
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment