diff --git a/frontend/src/components/Timer/index.tsx b/frontend/src/components/Timer/index.tsx index c800bb4..ff15dfe 100644 --- a/frontend/src/components/Timer/index.tsx +++ b/frontend/src/components/Timer/index.tsx @@ -17,17 +17,24 @@ export default function Timer(props: Props) { endsAt = new Date('2023-11-29T13:10:10.000Z'); const { remainMiliSeconds } = useTimer({ socket, endsAt }); + if (isConnected && remainMiliSeconds !== -1) { + // 연결도 되어있고, 서버 시간도 도착해서 count down을 시작할 수 있을 때 + return ( +
+
+ {formatMilliSecond(remainMiliSeconds, 'hh:mm:ss')} +
+
+ ); + } + return (
- {isConnected && remainMiliSeconds !== -1 ? ( - {formatMilliSecond(remainMiliSeconds, 'hh:mm:ss')} - ) : ( -
- 연결 중... - -
- )} +
+ 연결 중... + +
); @@ -38,7 +45,7 @@ const wrapperStyle = css({ alignItems: 'center', }); -const disConnectedStyle = css({ +const disconnectedStyle = css({ color: 'darkred', });