From 6f060850ac1c73fc725bd0a92f0cd00275ca5186 Mon Sep 17 00:00:00 2001 From: MinSeobKim Date: Wed, 8 Nov 2023 15:16:19 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Feat=20:=20Layout=EC=97=90=20Wrapper?= =?UTF-8?q?=EB=A1=9C=20=EA=B8=B0=EB=B3=B8=20=ED=8B=80=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Components/Plate.tsx | 11 ----------- Components/Wrapper.tsx | 14 ++++++++++++++ app/layout.tsx | 7 ++++++- app/open/page.tsx | 21 +++++++++------------ tailwind.config.ts | 5 +++++ 5 files changed, 34 insertions(+), 24 deletions(-) delete mode 100644 Components/Plate.tsx create mode 100644 Components/Wrapper.tsx diff --git a/Components/Plate.tsx b/Components/Plate.tsx deleted file mode 100644 index 6e583e85..00000000 --- a/Components/Plate.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -const Plate = ({ children }: { children: React.ReactNode }) => { - return ( -
- {children} -
- ); -}; - -export default Plate; diff --git a/Components/Wrapper.tsx b/Components/Wrapper.tsx new file mode 100644 index 00000000..de1e65c1 --- /dev/null +++ b/Components/Wrapper.tsx @@ -0,0 +1,14 @@ +import React from 'react'; + +const Wrapper = ({ children }: { children: React.ReactNode }) => { + return ( +
+
+ 헤더 +
+ {children} +
+ ); +}; + +export default Wrapper; diff --git a/app/layout.tsx b/app/layout.tsx index 4435ed7e..0cdcedf8 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -2,6 +2,7 @@ import type { Metadata } from 'next'; import { Inter } from 'next/font/google'; import './globals.css'; import ClientProviders from '@/Components/Provider/ClientProvider'; +import Wrapper from '@/Components/Wrapper'; const inter = Inter({ subsets: ['latin'] }); @@ -18,7 +19,11 @@ export default function RootLayout({ return ( - {children} + +
+ {children} +
+
); diff --git a/app/open/page.tsx b/app/open/page.tsx index 7888ec3e..40b2ff35 100644 --- a/app/open/page.tsx +++ b/app/open/page.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import Plate from '@/Components/Plate'; import { fetchAllChat } from './open.utils'; type ChatData = { @@ -16,17 +15,15 @@ const Open = async () => { const result = await fetchAllChat(accessToken); console.log(result); return ( - -
- {result.chats.map((chat: ChatData) => { - return ( -
-
{chat.name}
-
- ); - })} -
-
+
+ {result.chats.map((chat: ChatData) => { + return ( +
+
{chat.name}
+
+ ); + })} +
); }; diff --git a/tailwind.config.ts b/tailwind.config.ts index 7d89807e..79d51a5f 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -11,6 +11,11 @@ const config: Config = withMT({ 'path-to-your-node_modules/@material-tailwind/react/theme/components/**/*.{js,ts,jsx,tsx}', ], theme: { + screens: { + sm: '425px', + md: '768px', + lg: '1024px', + }, extend: { colors: { primary: '#FF6363', From 7173134481a6c54f83492600a4fbc00129b78218 Mon Sep 17 00:00:00 2001 From: MinSeobKim Date: Wed, 8 Nov 2023 15:47:52 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Chore=20:=20react-hook-form=20=EC=84=A4?= =?UTF-8?q?=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/open/open.utils.ts | 2 +- app/open/page.tsx | 2 +- package-lock.json | 16 ++++++++++++++++ package.json | 1 + 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/open/open.utils.ts b/app/open/open.utils.ts index e3b7bc41..8554931d 100644 --- a/app/open/open.utils.ts +++ b/app/open/open.utils.ts @@ -1,4 +1,4 @@ -export const fetchAllChat = async (token: string) => { +export const fetchAllChat = async (token: string, userId: string) => { const res = await fetch('https://fastcampus-chat.net/chat', { method: 'GET', headers: { diff --git a/app/open/page.tsx b/app/open/page.tsx index 40b2ff35..3e2296b4 100644 --- a/app/open/page.tsx +++ b/app/open/page.tsx @@ -12,7 +12,7 @@ type ChatData = { const Open = async () => { const accessToken = process.env.ACCESS_TOKEN as string; - const result = await fetchAllChat(accessToken); + const result = await fetchAllChat(accessToken, 'minseob'); console.log(result); return (
diff --git a/package-lock.json b/package-lock.json index b620c62d..f1afe716 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "next": "14.0.1", "react": "^18", "react-dom": "^18", + "react-hook-form": "^7.48.2", "recoil": "^0.7.7", "socket.io": "^4.7.2" }, @@ -4025,6 +4026,21 @@ "react": "^18.2.0" } }, + "node_modules/react-hook-form": { + "version": "7.48.2", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.48.2.tgz", + "integrity": "sha512-H0T2InFQb1hX7qKtDIZmvpU1Xfn/bdahWBN1fH19gSe4bBEqTfmlr7H3XWTaVtiK4/tpPaI1F3355GPMZYge+A==", + "engines": { + "node": ">=12.22.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", diff --git a/package.json b/package.json index 0fb77961..1c4b1367 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "next": "14.0.1", "react": "^18", "react-dom": "^18", + "react-hook-form": "^7.48.2", "recoil": "^0.7.7", "socket.io": "^4.7.2" },