Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
feat : block submit when expired
Browse files Browse the repository at this point in the history
  • Loading branch information
kasterra committed May 22, 2024
1 parent 0f6a41d commit 1a5fa97
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@ const LabDetail = () => {
채점 기록
</button>
</Link>
<button
className={styles["submit-button"]}
onClick={() => setIsSubmitModalOpen(true)}
>
정답 제출
</button>
{new Date(practiceDetail!.end_time) > new Date() ? (
<button
className={styles["submit-button"]}
onClick={() => setIsSubmitModalOpen(true)}
>
정답 제출
</button>
) : (
<div className={styles["submit-button"]}>제출 기한 경과!</div>
)}
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function remainingTimeToString(time: number) {
if (day > 0) ret += `${day}일 \n`;
if (hour > 0) ret += `${hour}시간 \n`;
if (minute > 0) ret += `${minute}분`;
if (ret === "") ret = "제출 기한 경과!";
return ret;
}

Expand Down

0 comments on commit 1a5fa97

Please sign in to comment.