Skip to content

Commit e2a12fd

Browse files
authored
[스타일 수정] 페이지 Root 위치값 (#352)
* feat(atom): RootBox 추가 * feat: RootBox 적용
1 parent 0976bc5 commit e2a12fd

File tree

7 files changed

+54
-35
lines changed

7 files changed

+54
-35
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { HTMLAttributes } from "react";
2+
3+
interface RootBoxProps extends HTMLAttributes<HTMLDivElement> {}
4+
5+
const RootBox = ({ children, ...props }: RootBoxProps) => (
6+
<div {...props} className="m-auto max-w-[1280px] items-center mt-20 px-5">
7+
{children}
8+
</div>
9+
);
10+
11+
export default RootBox;

src/pages/404.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
import RootBox from "@Components/common/atom/box/RootBox";
12
import { NextPage } from "next";
23

34
const NotFoundPage: NextPage = () => {
45
return (
5-
<div className="md:mx-20 2xl:mx-60">
6+
<RootBox>
67
<article className="text-center ">
78
<header>
89
<h1>404</h1>
910
</header>
1011
<p>페이지를 찾을 수 없습니다.</p>
1112
</article>
12-
</div>
13+
</RootBox>
1314
);
1415
};
1516

src/pages/blog/[username].tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { UserInfoProfile, PostCardList } from "@Components/modules/blog";
77
import useGetStringTypeToRouter from "@Hooks/router/useGetStringTypeToRouter";
88
import api from "@Library/api";
99
import { userBlogDetailSeo } from "@Library/utility/seo";
10+
import RootBox from "@Components/common/atom/box/RootBox";
1011

1112
interface BlogPagePageProps {
1213
seo: DefaultSeoProps;
@@ -19,7 +20,7 @@ const BlogPage: NextPage<BlogPagePageProps> = ({ seo }: BlogPagePageProps) => {
1920
<NextSeo {...seo} />
2021
<CategorySortButtonList userId={1} />
2122

22-
<div className="m-auto max-w-[1280px] h-full mt-20 items-center px-5">
23+
<RootBox>
2324
<div className="grid justify-center grid-flow-row p-3 md:justify-between md:grid-flow-col">
2425
<div className="w-full max-w-[450px]">
2526
<UserInfoProfile userId={1} />
@@ -54,7 +55,7 @@ const BlogPage: NextPage<BlogPagePageProps> = ({ seo }: BlogPagePageProps) => {
5455
userId={1}
5556
/>
5657
</div>
57-
</div>
58+
</RootBox>
5859
</div>
5960
);
6061
};

src/pages/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "@Library/constants/post";
1414
import useGetStringTypeToRouter from "@Hooks/router/useGetStringTypeToRouter";
1515
import DateScopeLink from "@Components/common/molecules/link/DateScopeLink";
16+
import RootBox from "@Components/common/atom/box/RootBox";
1617

1718
const Home: NextPage = () => {
1819
const categoryName = useGetStringTypeToRouter("category");
@@ -21,7 +22,7 @@ const Home: NextPage = () => {
2122
<div>
2223
<IntroThumbnail />
2324
<CategorySortButtonList />
24-
<div className="m-auto max-w-[1280px] items-center px-5">
25+
<RootBox>
2526
<div className="my-10">
2627
<CardTitle
2728
title={
@@ -62,7 +63,7 @@ const Home: NextPage = () => {
6263
/>
6364
</div>
6465
</div>
65-
</div>
66+
</RootBox>
6667
</div>
6768
);
6869
};

src/pages/post/[postId].tsx

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import useGetPostDetailQuery from "@Hooks/react-query/post/useGetPostDetailQuery
1010
import useGetStringTypeToRouter from "@Hooks/router/useGetStringTypeToRouter";
1111
import api from "@Library/api";
1212
import { notFoundPostSeo, postDefaultSeo } from "@Library/utility/seo";
13+
import RootBox from "@Components/common/atom/box/RootBox";
1314

1415
interface PostDetailPageProps {
1516
seo: DefaultSeoProps;
@@ -31,32 +32,34 @@ const PostDetailPage: NextPage<PostDetailPageProps> = ({
3132
return (
3233
<div>
3334
<DefaultSeo {...newSeo} />
34-
<div>
35-
<article className="w-full">
36-
<PostHeader post={post} />
37-
<figure>
38-
<PostThumbnail
39-
id={post.id}
40-
thumbnailUrl={post.thumbnailUrl}
41-
title={post.title}
42-
/>
43-
</figure>
44-
<div className="mt-5 lg:grid lg:grid-flow-col lg:space-x-5 lg:grid-cols-3">
45-
<div className="lg:col-span-2">
46-
<TiptapViewer content={JSON.parse(post.content)} />
47-
</div>
48-
<section>
49-
<div className="w-full rounded h-fit bg-neutral-100 dark:bg-neutral-800">
50-
<PostWriter userInfo={post.user} />
35+
<RootBox>
36+
<div>
37+
<article className="w-full">
38+
<PostHeader post={post} />
39+
<figure>
40+
<PostThumbnail
41+
id={post.id}
42+
thumbnailUrl={post.thumbnailUrl}
43+
title={post.title}
44+
/>
45+
</figure>
46+
<div className="mt-5 lg:grid lg:grid-flow-col lg:space-x-5 lg:grid-cols-3">
47+
<div className="lg:col-span-2">
48+
<TiptapViewer content={JSON.parse(post.content)} />
5149
</div>
52-
</section>
53-
</div>
54-
</article>
55-
</div>
56-
<div className="mt-5">
57-
<PostLike postId={post.id} count={post.like} />
58-
<Comment postId={post.id} />
59-
</div>
50+
<section>
51+
<div className="w-full rounded h-fit bg-neutral-100 dark:bg-neutral-800">
52+
<PostWriter userInfo={post.user} />
53+
</div>
54+
</section>
55+
</div>
56+
</article>
57+
</div>
58+
<div className="mt-5">
59+
<PostLike postId={post.id} count={post.like} />
60+
<Comment postId={post.id} />
61+
</div>
62+
</RootBox>
6063
</div>
6164
);
6265
};

src/pages/settings.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import useHandleSubmit from "@Hooks/pages/settings/hooks/useHandleSubmit";
1616
import useGetMeQuery from "@Hooks/react-query/user/useGetMeQuery";
1717

1818
import UserSettingTypes from "@Library/api/users/interface/userSettingTypes";
19+
import RootBox from "@Components/common/atom/box/RootBox";
1920

2021
const SettingPage: NextPage = () => {
2122
const router = useRouter();
@@ -34,7 +35,7 @@ const SettingPage: NextPage = () => {
3435
if (userInfo.isLoading) return <h1>유저 설정 로딩중..</h1>;
3536

3637
return (
37-
<div className="m-auto max-w-[1000px] h-full p-10 items-center px-5">
38+
<RootBox>
3839
<Head>
3940
<title>설정</title>
4041
</Head>
@@ -51,7 +52,7 @@ const SettingPage: NextPage = () => {
5152
</form>
5253
</FormProvider>
5354
</div>
54-
</div>
55+
</RootBox>
5556
);
5657
};
5758

src/pages/writer.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ import { TITLE_WRITER } from "@Library/constants/writer";
1414
import useHandleSummit from "@Hooks/pages/writer/hooks/useHandleSummit";
1515

1616
import WriterFormTypes from "@Components/modules/writer/interface/writerFormTypes";
17+
import RootBox from "@Components/common/atom/box/RootBox";
1718

1819
const WriterPage: NextPage = () => {
1920
const method = useForm<WriterFormTypes>();
2021
const onSummit = useHandleSummit();
2122
return (
22-
<div className="m-auto max-w-[1000px] h-full p-10 items-center px-5">
23+
<RootBox>
2324
<Head>
2425
<title>{TITLE_WRITER.ko}</title>
2526
</Head>
@@ -37,7 +38,7 @@ const WriterPage: NextPage = () => {
3738
</div>
3839
</form>
3940
</FormProvider>
40-
</div>
41+
</RootBox>
4142
);
4243
};
4344

0 commit comments

Comments
 (0)