Skip to content

Commit 6227d93

Browse files
committed
refactor : ResultLetter 타입 변경
1 parent 45bdda0 commit 6227d93

File tree

7 files changed

+25
-22
lines changed

7 files changed

+25
-22
lines changed

src/components/ResultLetter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function ResultLetter({
1515

1616
return (
1717
<div
18-
className="flex w-full flex-col gap-[35px] p-4"
18+
className="flex w-full max-w-[300px] flex-col gap-[35px] p-4"
1919
style={{ backgroundImage: `url(${letterPink})` }}
2020
>
2121
<div className="flex justify-between gap-3">

src/pages/Admin/Report.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default function ReportManage() {
8080
},
8181
},
8282
];
83-
const [allReports, setAllReports] = useState();
83+
// const [allReports, setAllReports] = useState();
8484
useEffect(() => {
8585
const getAllReports = async () => {
8686
const res = await client.get('/api/reports');

src/pages/RandomLetters/Matched.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function Matched() {
99
{'00'} : {'00'} : {'00'}
1010
</p>
1111
<div className="mt-2 w-75">
12-
<ResultLetter stampName="기타" title="테스트용가리" />
12+
<ResultLetter categoryName="ETC" title="테스트용가리" />
1313
</div>
1414
<button className="bg-primary-3 body-m mt-12.5 w-full rounded-lg py-2" onClick={() => {}}>
1515
매칭 취소하기

src/pages/RandomLetters/MatchingSelect.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ export default function MatchingSelect({
1818
const [selectedCategory, setSelectedCategory] = useState('전체');
1919

2020
const CATEGORY_LIST = ['전체', '위로와 공감', '축하와 응원', '고민 상담', '기타'];
21-
const DUMMY_LIST: { stampName: Stamp; title: string }[] = [
22-
{ stampName: '위로와 공감', title: '위로가 필요해요' },
23-
{ stampName: '축하와 응원', title: '저에게 미움받을 용기를 주세요' },
24-
{ stampName: '고민 상담', title: '삶이 무료해서 고민이에요' },
25-
{ stampName: '기타', title: '어제 꾼 꿈이 신기했어요' },
26-
{ stampName: '고민 상담', title: '삶이 유료해서 고민이에요' },
27-
{ stampName: '축하와 응원', title: '어제 취업했어요!!!!' },
28-
{ stampName: '축하와 응원', title: '어제 게임 신기록 세웠어요!!!!!' },
29-
{ stampName: '기타', title: '기타는 핑거스타일이 멋있는거 같아요' },
30-
{ stampName: '위로와 공감', title: '10년지기 친구가 이사를 가요' },
21+
const DUMMY_LIST: { categoryName: Category; title: string }[] = [
22+
{ categoryName: 'CONSOLATION', title: '위로가 필요해요' },
23+
{ categoryName: 'CELEBRATION', title: '저에게 미움받을 용기를 주세요' },
24+
{ categoryName: 'CONSULT', title: '삶이 무료해서 고민이에요' },
25+
{ categoryName: 'ETC', title: '어제 꾼 꿈이 신기했어요' },
26+
{ categoryName: 'CONSULT', title: '삶이 유료해서 고민이에요' },
27+
{ categoryName: 'CELEBRATION', title: '어제 취업했어요!!!!' },
28+
{ categoryName: 'CELEBRATION', title: '어제 게임 신기록 세웠어요!!!!!' },
29+
{ categoryName: 'ETC', title: '기타는 핑거스타일이 멋있는거 같아요' },
30+
{ categoryName: 'CONSOLATION', title: '10년지기 친구가 이사를 가요' },
3131
{
32-
stampName: '기타',
32+
categoryName: 'ETC',
3333
title:
3434
'햄부기햄북 햄북어 햄북스딱스 함부르크햄부가우가 햄비기햄부거 햄부가티햄부기온앤 온 을 차려오거라.',
3535
},
@@ -53,10 +53,13 @@ export default function MatchingSelect({
5353
className="w-full cursor-pointer"
5454
onClick={() => {
5555
setOpenModal(true);
56-
setSelectedLetter(() => ({ stampName: list.stampName, title: list.title }));
56+
setSelectedLetter(() => ({
57+
categoryName: list.categoryName,
58+
title: list.title,
59+
}));
5760
}}
5861
>
59-
<ResultLetter stampName={list.stampName} title={list.title} />
62+
<ResultLetter categoryName={list.categoryName} title={list.title} />
6063
</div>
6164
</SwiperSlide>
6265
);

src/pages/RandomLetters/MatchingSelectModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function MatchingSelectModal({
1919
<span>수락한 편지는 5분이 지나면 취소할 수 없습니다.</span>
2020
</div>
2121
<div className="mt-4 w-full">
22-
<ResultLetter stampName={selectedLetter.stampName} title={selectedLetter.title} />
22+
<ResultLetter categoryName={selectedLetter.categoryName} title={selectedLetter.title} />
2323
</div>
2424
<div className="mt-12.5 flex w-[300px] gap-4">
2525
<button

src/pages/RandomLetters/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import MatchingSelectModal from './MatchingSelectModal';
99

1010
const RandomLettersPage = () => {
1111
const [openModal, setOpenModal] = useState<boolean>(false);
12-
const [matched, setMatched] = useState<boolean>(false);
12+
const [matched] = useState<boolean>(false); //setMatched 임시 제거
1313
const [selectedLetter, setSelectedLetter] = useState<SelectedLetter>({
14-
stampName: '기타',
14+
categoryName: 'ETC',
1515
title: 'error',
1616
});
1717

1818
return (
1919
<>
20-
<div className="flex grow flex-col items-center overflow-hidden">
20+
<div className="z-10 flex grow flex-col items-center overflow-hidden">
2121
<PageTitle className="mt-20">
2222
{!matched ? '답장하고 싶은 편지를 선택해주세요!' : '이미 답장 중인 편지가 있어요!'}
2323
</PageTitle>
@@ -26,11 +26,11 @@ const RandomLettersPage = () => {
2626
) : (
2727
<Matched />
2828
)}
29-
<BackgroundBottom />
3029
{openModal && (
3130
<MatchingSelectModal setOpenModal={setOpenModal} selectedLetter={selectedLetter} />
3231
)}
3332
</div>
33+
<BackgroundBottom />
3434
</>
3535
);
3636
};

src/types/random.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
interface SelectedLetter {
2-
stampName: Stamp;
2+
categoryName: Category;
33
title: string;
44
}

0 commit comments

Comments
 (0)