-
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.
Merge pull request #214 from INtiful/fix/homin/KAN-133-gatherings-tag…
…-message fix: tag message 렌더링 수정
- Loading branch information
Showing
11 changed files
with
87 additions
and
45 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 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
File renamed without changes.
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,25 @@ | ||
import { formatTimeHours } from '../../../../utils/formatDate'; | ||
|
||
const getTagMessage = ( | ||
daysLeft: number | null, | ||
endTime: string, | ||
isGatheringFull?: boolean, | ||
) => { | ||
if (isGatheringFull) { | ||
return '마감된 모임입니다.'; | ||
} | ||
|
||
if (daysLeft === null) return ''; | ||
|
||
if (daysLeft < 0) { | ||
return '마감된 모임입니다.'; | ||
} else if (Object.is(daysLeft, -0)) { | ||
return '마감된 모임입니다.'; | ||
} else if (daysLeft === 0) { | ||
return `오늘 ${formatTimeHours(endTime)}시 마감`; | ||
} else { | ||
return `${daysLeft}일 후 마감`; | ||
} | ||
}; | ||
|
||
export default getTagMessage; |
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,10 @@ | ||
import { CLOSING_IN_A_WEEK } from '@/constants/common'; | ||
|
||
const isClosingTagVisible = ( | ||
daysLeft: number, | ||
isGatheringFull: boolean, | ||
): boolean => { | ||
return daysLeft <= CLOSING_IN_A_WEEK || isGatheringFull; | ||
}; | ||
|
||
export default isClosingTagVisible; |
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,8 @@ | ||
const isGatheringFull = ( | ||
participantCount: number, | ||
capacity: number, | ||
): boolean => { | ||
return participantCount >= capacity; | ||
}; | ||
|
||
export default isGatheringFull; |
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.