Skip to content

Commit

Permalink
fix : 500일때 해당 페이지 보여주도록 바꿈
Browse files Browse the repository at this point in the history
  • Loading branch information
godhyzzang committed Nov 28, 2024
1 parent e746250 commit a69d9a8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
44 changes: 22 additions & 22 deletions src/app/(default)/learn/listening/detail/[id]/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@ export default function Error({

// TODO(@godhyzzang) : 다른 요인이 500유발하는 경우 있을 수도 있음.
const router = useRouter();
return error.message.includes('500') ? (
router.back()
) : (
<div className=" w-full h-full py-16 flex items-center justify-center bg-gradient-to-r text-purple-600">
<div className="container p-4 md:px-6 flex flex-col items-center justify-center space-y-12 text-center">
<h1 className="font-medium text-2xl drop-shadow-lg ">
에러가 발생했습니다 : {error.message}
</h1>
return (
error.message.includes('500') && (
<div className=" w-full h-full py-16 flex items-center justify-center bg-gradient-to-r text-purple-600">
<div className="container p-4 md:px-6 flex flex-col items-center justify-center space-y-12 text-center">
<h1 className="font-medium text-2xl drop-shadow-lg ">
에러가 발생했습니다 : {error.message}
</h1>

<div className="flex flex-col ">
<Button
className="bg-white text-purple-600 hover:bg-white/90 px-8 py-3 text-lg font-semibold rounded-full transition-all duration-300 ease-in-out transform hover:scale-105 mt-6"
onClick={() => router.back()}
>
이전 페이지로 돌아가기
</Button>
<Button
className="bg-white text-purple-600 hover:bg-white/90 px-8 py-3 text-lg font-semibold rounded-full transition-all duration-300 ease-in-out transform hover:scale-105 mt-6"
onClick={() => reset()}
>
다시 시도하기
</Button>
<div className="flex flex-col ">
<Button
className="bg-white text-purple-600 hover:bg-white/90 px-8 py-3 text-lg font-semibold rounded-full transition-all duration-300 ease-in-out transform hover:scale-105 mt-6"
onClick={() => router.back()}
>
이전 페이지로 돌아가기
</Button>
<Button
className="bg-white text-purple-600 hover:bg-white/90 px-8 py-3 text-lg font-semibold rounded-full transition-all duration-300 ease-in-out transform hover:scale-105 mt-6"
onClick={() => reset()}
>
다시 시도하기
</Button>
</div>
</div>
</div>
</div>
)
);
}
44 changes: 22 additions & 22 deletions src/app/(default)/learn/reading/detail/[id]/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@ export default function Error({

// TODO(@godhyzzang) : 다른 요인이 500유발하는 경우 있을 수도 있음.
const router = useRouter();
return error.message.includes('500') ? (
router.back()
) : (
<div className=" w-full h-full py-16 flex items-center justify-center bg-gradient-to-r text-purple-600">
<div className="container p-4 md:px-6 flex flex-col items-center justify-center space-y-12 text-center">
<h1 className="font-medium text-2xl drop-shadow-lg ">
에러가 발생했습니다 : {error.message}
</h1>
return (
error.message.includes('500') && (
<div className=" w-full h-full py-16 flex items-center justify-center bg-gradient-to-r text-purple-600">
<div className="container p-4 md:px-6 flex flex-col items-center justify-center space-y-12 text-center">
<h1 className="font-medium text-2xl drop-shadow-lg ">
에러가 발생했습니다 : {error.message}
</h1>

<div className="flex flex-col ">
<Button
className="bg-white text-purple-600 hover:bg-white/90 px-8 py-3 text-lg font-semibold rounded-full transition-all duration-300 ease-in-out transform hover:scale-105 mt-6"
onClick={() => router.back()}
>
이전 페이지로 돌아가기
</Button>
<Button
className="bg-white text-purple-600 hover:bg-white/90 px-8 py-3 text-lg font-semibold rounded-full transition-all duration-300 ease-in-out transform hover:scale-105 mt-6"
onClick={() => reset()}
>
다시 시도하기
</Button>
<div className="flex flex-col ">
<Button
className="bg-white text-purple-600 hover:bg-white/90 px-8 py-3 text-lg font-semibold rounded-full transition-all duration-300 ease-in-out transform hover:scale-105 mt-6"
onClick={() => router.back()}
>
이전 페이지로 돌아가기
</Button>
<Button
className="bg-white text-purple-600 hover:bg-white/90 px-8 py-3 text-lg font-semibold rounded-full transition-all duration-300 ease-in-out transform hover:scale-105 mt-6"
onClick={() => reset()}
>
다시 시도하기
</Button>
</div>
</div>
</div>
</div>
)
);
}

0 comments on commit a69d9a8

Please sign in to comment.