-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1542 from 42organization/agenda
[test-deploy] 라우터 쿼리, 반응형 ui, 에러처리
- Loading branch information
Showing
89 changed files
with
952 additions
and
586 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
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
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 |
---|---|---|
@@ -1,13 +1,30 @@ | ||
import React from 'react'; | ||
import styles from 'styles/agenda/Home/AgendaDeadLine.module.scss'; | ||
|
||
// props : API | ||
const AgendaDeadLine = () => { | ||
return ( | ||
<div className={styles.agendaItemDeadLineBox}> | ||
<div className={styles.agendaDeadLineText}>모집마감</div> | ||
<div className={styles.agendaDeadLine}>D-2</div> | ||
</div> | ||
); | ||
interface deadLineProps { | ||
deadLine: string | Date; | ||
} | ||
|
||
const AgendaDeadLine = ({ deadLine }: deadLineProps) => { | ||
const currentDate = new Date(); | ||
const deadLineDate = new Date(deadLine); | ||
|
||
const timeDiff = deadLineDate.getTime() - currentDate.getTime(); | ||
let daysLeft; | ||
|
||
if (timeDiff == 0) daysLeft = 'Day'; | ||
else if (timeDiff > 0) daysLeft = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)); | ||
|
||
if (timeDiff >= 0) { | ||
return ( | ||
<div className={styles.agendaItemDeadLineBox}> | ||
<div className={styles.agendaDeadLineText}>모집마감</div> | ||
<div className={styles.agendaDeadLine}>D-{daysLeft}</div> | ||
</div> | ||
); | ||
} | ||
|
||
return null; | ||
}; | ||
|
||
export default AgendaDeadLine; |
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
Oops, something went wrong.