-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCardFlip.js
44 lines (39 loc) · 1.17 KB
/
CardFlip.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React, { useState } from "react";
import { Button } from "react-bootstrap";
import ReactCardFlip from "react-card-flip";
import { Cursor } from "react-bootstrap-icons";
const CardFlipComponent = (props) => {
const [isFlipped, setIsFlipped] = useState(false);
function cardFlip() {
setIsFlipped(!isFlipped);
}
return (
<ReactCardFlip
isFlipped={isFlipped}
flipDirection="horizontal"
cardStyles={{ height: "130%" }}
>
<div className="frontCard">
<span style={{ fontSize: "225%" }}>{props.gameName}</span>
<br /> <span style={{ fontSize: "120%" }}>RATING</span>
<br />
<div style={{ padding: "5%" }}>
<Button variant="outline-secondary" onClick={cardFlip}>
<Cursor color="white" />
</Button>
</div>
</div>
<div
className="backCard"
style={{ paddingTop: "15%", paddingBottom: "15%" }}
>
<span style={{ fontSize: "330%" }}>{props.gameRating}</span>
<br />
<Button variant="outline-secondary" onClick={cardFlip}>
Back
</Button>
</div>
</ReactCardFlip>
);
};
export default CardFlipComponent;