Skip to content

Commit

Permalink
[KAN-15] fix: 수용인원 관련 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
BeMatthewsong committed Sep 9, 2024
1 parent f0b2552 commit a00de4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/components/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ import { IconArrow, IconCheckCircle, IconPerson } from '@/public/icons';

interface ProgressBarProps {
participantNumber: number;
capacity: number;
hasParticipantNumber: boolean;
hasOpeningConfirmed: boolean;
}

const ProgressBar = ({
participantNumber,
capacity,
hasParticipantNumber,
hasOpeningConfirmed,
}: ProgressBarProps) => {
const isOpeningConfirmed = participantNumber >= 5; // 개설 확정 여부 (boolean)
const isClosedGathering = participantNumber === 20; // 참여 인원이 20명인 경우 (boolean)
const isClosedGathering = participantNumber === capacity; // 참여 인원이 다 찬 경우 (boolean)

return (
<div className='flex gap-24'>
Expand Down Expand Up @@ -50,7 +52,7 @@ const ProgressBar = ({
<div className='flex h-4 w-full rounded-md bg-var-orange-100'>
<div
className={`h-full ${isClosedGathering ? 'bg-var-orange-400' : 'bg-var-orange-600'} transition-all ease-in-out`}
style={{ width: `${(participantNumber / 20) * 100}%` }}
style={{ width: `${(participantNumber / capacity) * 100}%` }}
></div>
</div>
</div>
Expand Down

0 comments on commit a00de4e

Please sign in to comment.