-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: webDomain basePath 함수 수정 (#107)
* fix: 환경변수 못부르는 문제 수정 * fix: countdown hydration error fix * fix: 환경변수 설정 위치 변경 * chore: why * chore: test * fix: 질문등록해도 릴레이질문 등록 모달 노출 제거 * chore:test * chore:test * chore: remove console
- Loading branch information
Showing
16 changed files
with
132 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
packages/web-domains/src/answer/common/components/Countdown/AnswerCountdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Txt } from '@sambad/sds/components'; | ||
import { colors } from '@sambad/sds/theme'; | ||
import dayjs from 'dayjs'; | ||
import dynamic from 'next/dynamic'; | ||
import { HTMLAttributes } from 'react'; | ||
import Countdown from 'react-countdown'; | ||
|
||
import { getRemainTime } from '../../../../home/common/utils/getRemainTime'; | ||
|
||
interface AnswerCountDownProps extends HTMLAttributes<HTMLDivElement> { | ||
timer: string | number | Date; | ||
} | ||
|
||
const CountdownRender = dynamic(() => import('./AnswerCountdownRender.tsx').then((mod) => mod.AnswerCountdownRender), { | ||
ssr: true, | ||
}); | ||
|
||
export const AnswerCountDown = ({ timer, ...rest }: AnswerCountDownProps) => { | ||
const remainTime = getRemainTime(timer); | ||
|
||
const isTenminuteleft = remainTime <= dayjs().minute(10).valueOf(); | ||
|
||
return ( | ||
<section | ||
css={{ | ||
width: '100%', | ||
padding: '0 40px', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
}} | ||
{...rest} | ||
> | ||
<Txt as="p" typography="body4" css={{ marginBottom: '8px' }} color={colors.grey600}> | ||
마감까지 남은 시간 | ||
</Txt> | ||
<Countdown | ||
date={remainTime} | ||
renderer={({ hours, minutes, seconds }) => ( | ||
<CountdownRender hours={hours} minutes={minutes} seconds={seconds} isTenminuteleft={isTenminuteleft} /> | ||
)} | ||
/> | ||
</section> | ||
); | ||
}; |
44 changes: 3 additions & 41 deletions
44
...wer/common/components/AnswerCountdown.tsx → ...nents/Countdown/AnswerCountdownRender.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...rc/home/features/progressing-question/components/QuestionInfo/InActiveCountdownRender.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
'use client'; | ||
|
||
import { Txt } from '@sds/components'; | ||
import { borderRadiusVariants, colors } from '@sds/theme'; | ||
|
||
export const InActiveCountdownRender = ({ | ||
hours, | ||
minutes, | ||
seconds, | ||
}: { | ||
hours: number; | ||
minutes: number; | ||
seconds: number; | ||
}) => { | ||
const renderHours = hours < 10 ? `0${hours}` : `${hours}`; | ||
const renderMinutes = minutes < 10 ? `0${minutes}` : `${minutes}`; | ||
const renderseconds = seconds < 10 ? `0${seconds}` : `${seconds}`; | ||
|
||
return ( | ||
<div | ||
css={{ | ||
width: '97px', | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
height: '29px', | ||
padding: '4px 8px', | ||
borderRadius: borderRadiusVariants.medium, | ||
backgroundColor: colors.grey300, | ||
marginTop: '16px', | ||
}} | ||
> | ||
<Txt typography="title3" color={colors.grey600}> | ||
{renderHours} | ||
</Txt> | ||
<Txt typography="title3" color={colors.grey600} css={{ padding: '0 4px' }}> | ||
: | ||
</Txt> | ||
<Txt typography="title3" color={colors.grey600}> | ||
{renderMinutes} | ||
</Txt> | ||
<Txt typography="title3" color={colors.grey600} css={{ padding: '0 4px' }}> | ||
: | ||
</Txt> | ||
<Txt typography="title3" color={colors.grey600}> | ||
{renderseconds} | ||
</Txt> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters