Skip to content

Commit

Permalink
Merge pull request #101 from WildCodeSchool-2023-09/fixjeu
Browse files Browse the repository at this point in the history
fixjeu
  • Loading branch information
samuelfaberdev authored Nov 10, 2023
2 parents b08991d + ac7a82c commit 804a2e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion frontend/src/components/Jeu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ function Jeu() {
className="gameOver text-white font-irish w-full h-full flex justify-center items-center text-9xl
max-sm:text-7xl max-sm:pb-32"
>
{score === 200 ? <Victory result /> : <Victory result={false} />}
{score === 200 ? (
<Victory result pV={pV.length} score={score} />
) : (
<Victory result={false} />
)}
</div>
)}
</div>
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/components/Victory.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import PropTypes from "prop-types";
import { motion } from "framer-motion";

function Victory({ result }) {
function Victory({ result, pV, score }) {
if (result) {
return (
<motion.p
initial={{ opacity: 0, scale: 2 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ duration: 0.5 }}
>
Victory!
<h1 className="text-center">Victory!</h1>
<p>Your score is {score * pV}</p>
</motion.p>
);
}
Expand All @@ -18,6 +19,8 @@ function Victory({ result }) {

Victory.propTypes = {
result: PropTypes.bool.isRequired,
pV: PropTypes.number.isRequired,
score: PropTypes.number.isRequired,
};

export default Victory;

0 comments on commit 804a2e9

Please sign in to comment.