Skip to content

Commit

Permalink
Merge pull request #305 from Team-Blitz-Steady/fix/#298/detail-error-…
Browse files Browse the repository at this point in the history
…page

🚨 Fix(#298): 상세 페이지 좋아요 api 수정 및 에러 페이지 새로고침 버튼 추가
  • Loading branch information
JIY00N2 authored Nov 30, 2023
2 parents 9ee0a7e + bfb656a commit e0a5237
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
20 changes: 6 additions & 14 deletions src/app/(steady)/steady/detail/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,20 +172,12 @@ const SteadyDetailPage = ({ params }: { params: { id: string } }) => {
/>
}
trigger={
<button onClick={() => mutate(steadyId)}>
{steadyDetailsData.isLiked ? (
<Icon
name="heart"
size={30}
color="text-st-red"
/>
) : (
<Icon
name="empty-heart"
size={30}
color="text-black"
/>
)}
<button>
<Icon
name="empty-heart"
size={30}
color="text-black"
/>
</button>
}
>
Expand Down
32 changes: 24 additions & 8 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ import type { AxiosError } from "axios";
import type { ErrorResponse } from "@/services/types";
import Button, { buttonSize } from "@/components/_common/Button";

const Error = ({ error }: { error: AxiosError<ErrorResponse> }) => {
const Error = ({
error,
reset,
}: {
error: AxiosError<ErrorResponse>;
reset: VoidFunction;
}) => {
const router = useRouter();
const { toast } = useToast();
useEffect(() => {
Expand All @@ -35,13 +41,23 @@ const Error = ({ error }: { error: AxiosError<ErrorResponse> }) => {
width={200}
height={100}
/>
<div className="text-30 font-bold">알 수 없는 에러가 발생했습니다.</div>
<Button
className={`${buttonSize.md} bg-st-primary text-st-white`}
onClick={() => router.replace("/")}
>
홈으로
</Button>
<div className="font-bold max-sm:text-26 sm:text-26 md:text-26 lg:text-28 xl:text-30">
알 수 없는 에러가 발생했습니다.
</div>
<div className="flex gap-20">
<Button
className={`${buttonSize.md} bg-st-primary text-st-white`}
onClick={() => reset()}
>
새로고침
</Button>
<Button
className={`${buttonSize.md} bg-st-primary text-st-white`}
onClick={() => router.replace("/")}
>
홈으로
</Button>
</div>
</div>
);
};
Expand Down

0 comments on commit e0a5237

Please sign in to comment.