diff --git a/.gitignore b/.gitignore index 8f322f0..93c57fb 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +.env diff --git a/public/google_signin.png b/public/google_signin.png new file mode 100644 index 0000000..c1e2c5c Binary files /dev/null and b/public/google_signin.png differ diff --git a/public/kakao_signin.png b/public/kakao_signin.png new file mode 100644 index 0000000..894c223 Binary files /dev/null and b/public/kakao_signin.png differ diff --git a/src/_shared/components/LandingLayout/LandingLayout.tsx b/src/_shared/components/LandingLayout/LandingLayout.tsx new file mode 100644 index 0000000..de16909 --- /dev/null +++ b/src/_shared/components/LandingLayout/LandingLayout.tsx @@ -0,0 +1,22 @@ +import { PropsWithChildren } from 'react'; +import Image from 'next/image'; + +export const LandingLayout = ({ children }: PropsWithChildren) => { + return ( + + + + + {children} + + + + ); +}; diff --git a/src/_shared/components/LandingLayout/index.ts b/src/_shared/components/LandingLayout/index.ts new file mode 100644 index 0000000..4c6a5af --- /dev/null +++ b/src/_shared/components/LandingLayout/index.ts @@ -0,0 +1 @@ +export { LandingLayout } from './LandingLayout'; diff --git a/src/_shared/components/NavBar/NavBar.tsx b/src/_shared/components/NavBar/NavBar.tsx new file mode 100644 index 0000000..526d9af --- /dev/null +++ b/src/_shared/components/NavBar/NavBar.tsx @@ -0,0 +1,28 @@ +import Link from 'next/link'; + +interface Props { + isLogin: boolean; +} + +export const NavBar = ({ isLogin }: Props) => { + return ( + + + Knocking + + {isLogin ? ( + + 내 이력서 + 내 계정 + + ) : ( + + 로그인 + + )} + + ); +}; diff --git a/src/_shared/components/NavBar/index.ts b/src/_shared/components/NavBar/index.ts new file mode 100644 index 0000000..766d96c --- /dev/null +++ b/src/_shared/components/NavBar/index.ts @@ -0,0 +1 @@ +export { NavBar } from './NavBar'; diff --git a/src/_shared/services/httpClient.ts b/src/_shared/services/httpClient.ts new file mode 100644 index 0000000..a0273ee --- /dev/null +++ b/src/_shared/services/httpClient.ts @@ -0,0 +1,26 @@ +import { cookies } from 'next/headers'; + +interface Props { + path: string; + method: 'GET' | 'POST' | 'PUT' | 'DELETE'; + body?: any; + headers?: any; +} + +export async function httpClient({ path, method, body, headers }: Props) { + try { + const response = await fetch(process.env.NEXT_PUBLIC_SERVER_URL + path, { + method, + body, + headers: { + ...headers, + 'Content-Type': 'application/json;charset=utf-8', + }, + credentials: 'include', + }); + const data = await response.text(); + return data; + } catch (e) { + console.log(e); + } +} diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx new file mode 100644 index 0000000..bc76a09 --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,31 @@ +import { LandingLayout } from '@/_shared/components/LandingLayout'; +import { NavBar } from '@/_shared/components/NavBar'; +import Image from 'next/image'; + +export default function Login() { + return ( + <> + + + + + + + + + + > + ); +} diff --git a/src/app/main/page.tsx b/src/app/main/page.tsx new file mode 100644 index 0000000..74dc336 --- /dev/null +++ b/src/app/main/page.tsx @@ -0,0 +1,13 @@ +import { LandingLayout } from '@/_shared/components/LandingLayout'; +import { NavBar } from '@/_shared/components/NavBar'; + +export default function Main() { + return ( + <> + + + 로그인 완료됐다구!!! + + > + ); +} diff --git a/src/app/page.tsx b/src/app/page.tsx index 52bb921..0c53c72 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,41 +1,37 @@ -import Image from 'next/image'; +import Link from 'next/link'; +import { cookies } from 'next/headers'; + +import { NavBar } from '@/_shared/components/NavBar'; +import { LandingLayout } from '@/_shared/components/LandingLayout'; +import { httpClient } from '@/_shared/services/httpClient'; + +export default async function Home() { + const data = await httpClient({ + path: '/auth/test', + method: 'GET', + headers: { + Cookie: cookies().toString(), + }, + }); + console.log(data); -export default function Home() { return ( <> - {/* TODO: NavBar */} - - Knocking - - 로그인 - - - - - - - - Knocking과 함께 더 쉬워진 이력서 쓰러가기 - - - {/* TODO: Button */} - 로그인 - - - - + + + + Knocking과 함께 더 쉬워진 이력서 쓰러가기 + + + + {/* TODO: Button */} + 로그인 + + + > ); }