Skip to content

Commit cb83cb2

Browse files
committed
[#123] 404 한글 문구로 수정, /post/id 없는경로 예외처리
404 한글 문구로 수정, /post/id 없는경로 예외처리
1 parent 2fc60b4 commit cb83cb2

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

src/features/rolling-paper/components/rolling-paper-list.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,15 @@ function RollingPaperList({ cardData, totalPages, currentPage, onTurnCards }) {
248248
const navigate = useNavigate();
249249

250250
const handleCardClick = (cardId) => {
251+
if(!cardId) {
252+
navigate("*");
253+
return;
254+
}
255+
251256
navigate(`/post/${cardId}`);
252257
};
258+
259+
253260
const profileImages = useMemo(
254261
() =>
255262
cardData.flatMap((card) =>

src/pages/404-page.jsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,20 @@ const ErrorNumber = styled.h1`
4545
font-weight: 900;
4646
color: var(--color-purple-700);
4747
margin: 0;
48-
font-size: 200px;
48+
font-size: 150px;
4949
5050
${media.mobile} {
51-
font-size: 130px;
51+
font-size: 110px;
5252
}
5353
`;
5454

5555
const ErrorComment = styled.span`
56-
font-size: 80px;
56+
font-size: 70px;
5757
color: #6e6293;
5858
font-weight: 700;
5959
6060
em {
61-
font-size: 100px;
61+
font-size: 90px;
6262
font-weight: 800;
6363
font-style: normal;
6464
color: #240079;
@@ -72,24 +72,20 @@ const ErrorComment = styled.span`
7272
}
7373
7474
${media.mobile} {
75-
font-size: 50px;
75+
font-size: 40px;
7676
em {
77-
font-size: 60px;
77+
font-size: 50px;
7878
}
7979
}
8080
`;
8181

8282
const ErrorCommentSofter = styled.span`
83-
font-size: 50px;
83+
font-size: 25px;
8484
color: #6e6293;
8585
font-weight: 400;
8686
87-
${media.tablet} {
88-
font-size: 40px;
89-
}
90-
9187
${media.mobile} {
92-
font-size: 30px;
88+
font-size: 18px;
9389
}
9490
`;
9591

@@ -133,10 +129,10 @@ const Error404Page = () => {
133129
<AirplaneSVG src={logoImage} />
134130
<ErrorNumber>404</ErrorNumber>
135131
<ErrorComment>
136-
<em>Oops!</em> Page Not Found...
132+
<em>앗 이런!</em> 페이지를 찾을 수 없습니다.
137133
</ErrorComment>
138134
<ErrorCommentSofter>
139-
Don't worry, let's get you back on track.
135+
페이지의 주소가 올바르지 않거나, 삭제 또는 다른 페이지로 변경되었습니다.
140136
</ErrorCommentSofter>
141137
<HomeButton
142138
size={BUTTON_SIZE.large}

src/pages/messages-page.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,12 @@ function MessagesPage() {
196196
} catch (error) {
197197
// TODO: Error 처리 필요
198198
console.error(error);
199+
navigate("/notfound", { replace: true });
199200
}
200201
}
201202

202203
fetchRollingPaper();
203-
}, [id]);
204+
}, [id, navigate]);
204205

205206
const content = (
206207
<>

0 commit comments

Comments
 (0)