From 3be48f27bb8f95abada610a587ad8da2f272a284 Mon Sep 17 00:00:00 2001 From: inthree3 <42310616+inthree3@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:07:34 +0900 Subject: [PATCH] chore: add color theme --- src/pages/PostListPage.tsx | 61 ++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/pages/PostListPage.tsx b/src/pages/PostListPage.tsx index aa5eb9b..354786a 100644 --- a/src/pages/PostListPage.tsx +++ b/src/pages/PostListPage.tsx @@ -1,4 +1,4 @@ -import { Box, Table, Button } from '@mantine/core'; +import { Box, Table, Button, useMantineTheme } from '@mantine/core'; import useSWR from 'swr'; import { Post } from '../api/post'; @@ -6,37 +6,40 @@ import { Link } from 'react-router-dom'; const PostListPage = () => { const { data } = useSWR<{ total: number; list: Post[] }>('/post'); + const theme = useMantineTheme(); return ( - - - - - Id - Title - Author - Views - CreatedAt - - - - {data?.list.map((post) => ( - - {post.id} - - {post.contents.title} - - {post.author.name} - {post.views} - {post.createdAt} + + +
+ + + Id + Title + Author + Views + CreatedAt - ))} - -
- - - - + + + {data?.list.map((post) => ( + + {post.id} + + {post.contents.title} + + {post.author.name} + {post.views} + {post.createdAt} + + ))} + + + + + + +
);