File tree 5 files changed +105
-15
lines changed
5 files changed +105
-15
lines changed Original file line number Diff line number Diff line change @@ -3,24 +3,47 @@ import { Link } from "react-router-dom";
3
3
import Header from "../header/Header" ;
4
4
import Main from "../main/Main" ;
5
5
6
+ import {
7
+ StyledFactPage ,
8
+ FactBubble ,
9
+ FactBubbleContainer ,
10
+ FactBubbleFact ,
11
+ WiseManContainer ,
12
+ WiseMan ,
13
+ WiseManText ,
14
+ } from "./FactPage.style" ;
15
+ import { LargeButton } from "../button/Button" ;
16
+ import FactBubbleImg from "../../assets/FactBubble.png" ;
17
+ import WiseManSvg from "../avatars/wise-man.svg" ;
18
+
6
19
const FactPage = ( { location : { score, data } } ) => {
7
20
return (
8
21
< React . Fragment >
9
22
< Header text = "Results" />
10
23
< Main >
11
- < p >
12
- Hey, well done! Just before we see your score, did you know:
13
- </ p >
14
- < div > { data [ 0 ] . Fact } </ div >
15
- < Link
16
- to = { {
17
- pathname : "/results" ,
24
+ < StyledFactPage >
25
+ < WiseManContainer >
26
+ < WiseManText >
27
+ Hey, well done! Just before we see your score, did
28
+ you know:
29
+ </ WiseManText >
30
+ < WiseMan src = { WiseManSvg } />
31
+ </ WiseManContainer >
32
+
33
+ < FactBubbleContainer >
34
+ < FactBubbleFact > { data [ 0 ] . Fact } </ FactBubbleFact >
35
+ < FactBubble src = { FactBubbleImg } />
36
+ </ FactBubbleContainer >
18
37
19
- score : score ,
20
- } }
21
- >
22
- See Your Results!
23
- </ Link >
38
+ < Link
39
+ to = { {
40
+ pathname : "/results" ,
41
+ score : score ,
42
+ } }
43
+ >
44
+ < LargeButton > See Your Results!</ LargeButton >
45
+ </ Link >
46
+ </ StyledFactPage >
24
47
</ Main >
25
48
</ React . Fragment >
26
49
) ;
Original file line number Diff line number Diff line change
1
+ import styled from "styled-components" ;
2
+ import GreenComicBG from "../../assets/GreenComicBG.jpg" ;
3
+ import FactBubbleImg from "../../assets/FactBubble.png" ;
4
+
5
+ const StyledFactPage = styled . div `
6
+ background-image: url(${ GreenComicBG } );
7
+ background-repeat: no-repeat;
8
+ background-size: cover;
9
+ background-position: center center;
10
+ font-family: Bangers;
11
+ font-style: normal;
12
+ font-weight: normal;
13
+ display: flex;
14
+ flex-wrap: wrap;
15
+ justify-content: center;
16
+ ` ;
17
+ const FactBubbleContainer = styled . div `
18
+ width: 40em;
19
+ height: 32em;
20
+ position: relative;
21
+ display: flex;
22
+ justify-content: center;
23
+ ` ;
24
+
25
+ const FactBubble = styled . img `
26
+ width: 40em;
27
+ height: auto;
28
+ ` ;
29
+ const FactBubbleFact = styled . div `
30
+ width: 16em;
31
+ text-align: center;
32
+ font-size: 1.5em;
33
+ margin: auto;
34
+ position: absolute;
35
+ height: inherit;
36
+ display: flex;
37
+ flex-direction: column;
38
+ justify-content: center;
39
+ transform: rotate(-20deg);
40
+ ` ;
41
+
42
+ const WiseManContainer = styled . div `
43
+ width: 32em;
44
+ ` ;
45
+
46
+ const WiseManText = styled . div `
47
+ width: fit-content;
48
+ border: 4px solid black;
49
+ border-radius: 1em;
50
+ background-color: white;
51
+ padding: 1em;
52
+ margin: 3em;
53
+ ` ;
54
+
55
+ const WiseMan = styled . img `
56
+ width: 16em;
57
+ ` ;
58
+
59
+ export {
60
+ StyledFactPage ,
61
+ FactBubble ,
62
+ FactBubbleContainer ,
63
+ FactBubbleFact ,
64
+ WiseManContainer ,
65
+ WiseMan ,
66
+ WiseManText ,
67
+ } ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import Main from "../main/Main";
14
14
15
15
const Game = ( { data } ) => {
16
16
const [ score , setScore ] = React . useState ( 0 ) ;
17
- const [ time , setTime ] = React . useState ( 10 ) ;
17
+ const [ time , setTime ] = React . useState ( 2 ) ;
18
18
const [ items , setItems ] = React . useState ( formatData ( data ) ) ;
19
19
const [ showModal , setShowModal ] = React . useState ( false ) ;
20
20
const [ active , setActive ] = React . useState ( false ) ;
@@ -79,7 +79,7 @@ const Game = ({ data }) => {
79
79
) ;
80
80
81
81
return (
82
- < React . Fragment data-testid = "game" >
82
+ < div data-testid = "game" >
83
83
< Header text = "Game" />
84
84
< Main >
85
85
< div >
@@ -134,7 +134,7 @@ const Game = ({ data }) => {
134
134
</ Link >
135
135
</ ReactModal >
136
136
</ Main >
137
- </ React . Fragment >
137
+ </ div >
138
138
) ;
139
139
} ;
140
140
You can’t perform that action at this time.
0 commit comments