Skip to content

Commit 7988034

Browse files
committed
refactor: 하단 배경 컴포넌트로 분리
1 parent db6ef4f commit 7988034

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import BgItem from '@/assets/images/field-4.png';
2+
3+
const BackgroundBottom = () => {
4+
return (
5+
<div
6+
className="fixed bottom-[-40px] left-1/2 z-[-10] h-42 w-full -translate-x-1/2 bg-[image:var(--bg-image)] bg-[length:100%_100%] bg-center opacity-70"
7+
style={{ '--bg-image': `url(${BgItem})` } as React.CSSProperties}
8+
/>
9+
);
10+
};
11+
12+
export default BackgroundBottom;

src/pages/RollingPaper/index.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { MasonryInfiniteGrid } from '@egjs/react-infinitegrid';
22
import { ChangeEvent, useState } from 'react';
33

44
import EnvelopeImg from '@/assets/images/envelope.png';
5-
import BgItem from '@/assets/images/field-4.png';
5+
import BackgroundBottom from '@/components/BackgroundBottom';
66
import MessageModal from '@/components/MessageModal';
77
import PageTitle from '@/components/PageTitle';
88
import ReportModal from '@/components/ReportModal';
@@ -66,7 +66,7 @@ const RollingPaperPage = () => {
6666
</MessageModal>
6767
)}
6868
<Header />
69-
<main className="flex grow flex-col items-center px-5 pt-4 pb-12">
69+
<main className="flex grow flex-col items-center px-5 pt-20 pb-12">
7070
<PageTitle className="mb-18 max-w-73 text-center">{DUMMY_TITLE}</PageTitle>
7171
<p className="body-sb text-gray-60 mb-2 w-full">등록된 편지 {DUMMY_MESSAGE_COUNT}</p>
7272
<section className="w-full">
@@ -87,10 +87,7 @@ const RollingPaperPage = () => {
8787
</p>
8888
</button>
8989
</main>
90-
<div
91-
className="fixed bottom-[-40px] left-1/2 z-[-10] h-42 w-full -translate-x-1/2 bg-[image:var(--bg-image)] bg-[length:100%_100%] bg-center opacity-70"
92-
style={{ '--bg-image': `url(${BgItem})` } as React.CSSProperties}
93-
/>
90+
<BackgroundBottom />
9491
</>
9592
);
9693
};

0 commit comments

Comments
 (0)