Skip to content

Commit

Permalink
fix: 인증 성공 실패 여부 상태 보여주기 (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
nayeon-hub authored Dec 5, 2023
1 parent 7ed73e0 commit 0eefb0e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/RoomDetail/components/RoomRoutine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ const RoomRoutine = ({
}))
});

const { chooseDate, serverTime } = useContext(DateRoomDetailContext);
const { chooseDate, serverTime, roomCreatedDate } = useContext(
DateRoomDetailContext
);

const certifyEndTime = new Date(serverTime);
certifyEndTime.setHours(certifyTime);
Expand Down Expand Up @@ -59,12 +61,15 @@ const RoomRoutine = ({
</FormProvider>
<div className="mb-[0.88rem] flex justify-between text-base">
<h4 className="text-black dark:text-white">나의 인증</h4>
{certifiedDates.includes(chooseDateString) || myCertificationImage ? (
{(isTodayRoom && serverTime.getTime() < certifyEndTime.getTime()) ||
(roomCreatedDate.getDate() === chooseDate.getDate() &&
roomCreatedDate.getTime() > certifyEndTime.getTime()) ? (
<></>
) : certifiedDates.includes(chooseDateString) ||
myCertificationImage ? (
<span className="text-light-point dark:text-dark-point">
인증 성공
</span>
) : isTodayRoom && serverTime.getTime() < certifyEndTime.getTime() ? (
<></>
) : (
<span className="text-danger">인증 실패</span>
)}
Expand Down

0 comments on commit 0eefb0e

Please sign in to comment.