Skip to content

Commit

Permalink
Merge pull request #193 from boostcampwm-2024/feature/#11
Browse files Browse the repository at this point in the history
[Feat] ๊ฒŒ์ž„ ๊ฒฐ๊ณผ ํ™”๋ฉด ๊ตฌ์„ฑ
  • Loading branch information
today-is-first authored Nov 28, 2024
2 parents 317f8c4 + 4125119 commit 16e0cc9
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,53 @@ interface IEndingPhaseProps {
isPinocoWin: boolean;
pinoco: string;
isGuessed: boolean;
guessingWord: string;
guessingWord: string | null;
} | null;
}

export default function EndingResult({ endingResult }: IEndingPhaseProps) {
if (!endingResult) return null;

const { isPinocoWin, pinoco, isGuessed, guessingWord } = endingResult;

const resultImage = isPinocoWin
? '/images/ending/pinocoWin.png'
: '/images/ending/geppettoWin.png';
const getEndingMessage = () => {
if (guessingWord && isGuessed) {
return (
<>
ํ”ผ๋…ธ์ฝ”๊ฐ€ ์ œ์‹œ์–ด๋ฅผ ๋งž์ถ”๋ฉฐ ์œ„๊ธฐ์—์„œ ๋ฒ—์–ด๋‚ฌ์Šต๋‹ˆ๋‹ค! ์ œ์ถœ๋œ ์ œ์‹œ์–ด:{' '}
<span className="font-extrabold">{guessingWord}</span>
</>
);
}

if (isPinocoWin) {
return <>ํ”ผ๋…ธ์ฝ”๊ฐ€ ์ž์‹ ์˜ ์ •์ฒด๋ฅผ ์ˆจ๊ธฐ๋ฉฐ ์ œํŽ˜ํ† ๋ฅผ ์†์˜€์Šต๋‹ˆ๋‹ค ๐Ÿ˜‰</>;
}

return <>ํ”ผ๋…ธ์ฝ”๊ฐ€ ์ œ์‹œ์–ด๋ฅผ ๋งž์ถ”์ง€ ๋ชปํ–ˆ์Šต๋‹ˆ๋‹ค ๐Ÿ”จ</>;
};

return (
<div className="flex flex-col items-center justify-center h-full space-y-4">
<h2 className="text-2xl font-bold text-white-default">
{isPinocoWin ? 'ํ”ผ๋…ธ์ฝ”๊ฐ€ ์Šน๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค ๐Ÿคฅ' : '์ œํŽ˜ํ† ๊ฐ€ ์Šน๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค ๐Ÿ”จ'}
<div className="flex flex-col items-center justify-center h-full space-y-8">
<img
src={resultImage}
alt={isPinocoWin ? 'ํ”ผ๋…ธ์ฝ” ์Šน๋ฆฌ' : '์ œํŽ˜ํ†  ์Šน๋ฆฌ'}
className="w-[60%] max-h-[400px] object-contain"
/>

<h2 className="text-3xl font-extrabold text-white-default">
{isPinocoWin ? 'ํ”ผ๋…ธ์ฝ”๊ฐ€ ์Šน๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค ๐Ÿคฅ' : '์ œํŽ˜ํ† ๊ฐ€ ์Šน๋ฆฌํ–ˆ์Šต๋‹ˆ๋‹ค ๐Ÿง“๐Ÿป'}
</h2>
{isGuessed && (
<p className="text-xl text-white-default">
ํ”ผ๋…ธ์ฝ” {pinoco}๊ฐ€ ์ œ์ถœํ•œ ์ œ์‹œ์–ด: {guessingWord}

<div className="text-2xl text-center text-white-default leading-relaxed">
<p>
ํ”ผ๋…ธ์ฝ”๋Š” <span className="font-extrabold">{pinoco}</span> ์˜€์Šต๋‹ˆ๋‹ค!
</p>
)}
<p>{getEndingMessage()}</p>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ export default function MainDisplay() {
setIsVoteSubmitted(true);
}
};

return (
<div className="relative flex flex-col flex-grow w-full p-4 mt-4 rounded-lg bg-green-default/40">
<div
className={`relative flex flex-col flex-grow w-full p-4 mt-4 rounded-lg ${
gamePhase === GAME_PHASE.ENDING ? 'bg-green-default' : 'bg-green-default/40'
}`}
>
<WordDisplay
gamePhase={gamePhase}
currentWord={currentWord}
Expand Down

0 comments on commit 16e0cc9

Please sign in to comment.