Skip to content

Commit

Permalink
Merge branch 'feature/#1' of https://github.com/MOVIEJOJO7/cat-talk i…
Browse files Browse the repository at this point in the history
…nto Feature/#2
  • Loading branch information
hhjs2 committed Nov 8, 2023
2 parents b68afae + 7173134 commit 26651a0
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 26 deletions.
11 changes: 0 additions & 11 deletions Components/Plate.tsx

This file was deleted.

14 changes: 14 additions & 0 deletions Components/Wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

const Wrapper = ({ children }: { children: React.ReactNode }) => {
return (
<section className="w-full sm:w-[425px] md:w-[645px] px-5 h-screen flex flex-col mx-auto bg-orange-300">
<header className="flex h-10 justify-between items-center bg-blue-700">
헤더
</header>
{children}
</section>
);
};

export default Wrapper;
7 changes: 6 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'] });

Expand All @@ -18,7 +19,11 @@ export default function RootLayout({
return (
<html lang="en">
<body className={inter.className}>
<ClientProviders>{children}</ClientProviders>
<ClientProviders>
<div className="bg-gray-500 h-screen">
<Wrapper>{children}</Wrapper>
</div>
</ClientProviders>
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion app/open/open.utils.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
23 changes: 10 additions & 13 deletions app/open/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import Plate from '@/Components/Plate';
import { fetchAllChat } from './open.utils';

type ChatData = {
Expand All @@ -13,20 +12,18 @@ 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 (
<Plate>
<div>
{result.chats.map((chat: ChatData) => {
return (
<div key={chat.id}>
<div>{chat.name}</div>
</div>
);
})}
</div>
</Plate>
<div className="flex flex-col bg-red-300">
{result.chats.map((chat: ChatData) => {
return (
<div key={chat.id}>
<div>{chat.name}</div>
</div>
);
})}
</div>
);
};

Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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"
},
Expand Down
5 changes: 5 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 26651a0

Please sign in to comment.