Skip to content

Commit 5f1f80b

Browse files
committed
✨ Creates history page
1 parent 7243ce9 commit 5f1f80b

File tree

5 files changed

+124
-10
lines changed

5 files changed

+124
-10
lines changed

src/index.scss

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ div.router {
2323
display: flex;
2424
flex-direction: column;
2525

26-
img {
26+
a.logo {
27+
text-align: center;
2728
margin-top: 50px;
29+
margin-bottom: 0px;
2830
}
2931
}
3032

@@ -65,6 +67,9 @@ div.container {
6567
}
6668

6769
header {
70+
position: fixed;
71+
height: 100%;
72+
6873
display: flex;
6974
flex-direction: column;
7075
align-items: flex-start;
@@ -73,9 +78,8 @@ div.container {
7378
background-color: var(--primaryColor);
7479
color: white;
7580
min-width: 35%;
76-
position: relative;
7781
z-index: 1;
78-
margin-right: 50px;
82+
// margin-right: 50px;
7983
padding-left: 40px;
8084

8185
&::before {
@@ -90,7 +94,7 @@ div.container {
9094
z-index: -1;
9195
}
9296

93-
img {
97+
a {
9498
margin-top: auto;
9599
}
96100

@@ -105,7 +109,10 @@ div.container {
105109
}
106110

107111
div.router {
108-
img {
112+
margin-left: calc(35% + 88px);
113+
width: 100%;
114+
115+
a.logo {
109116
display: none;
110117
}
111118
}

src/pages/History/index.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import React from 'react';
2+
import { Link } from 'react-router-dom';
3+
import { MdArrowBack } from 'react-icons/md';
4+
5+
import './styles.scss';
6+
7+
const History: React.FC = () => {
8+
return (
9+
<div id="history-page" className="container">
10+
<Link to="/">
11+
<div className="back">
12+
<MdArrowBack size={22} />
13+
<span>Voltar</span>
14+
</div>
15+
</Link>
16+
<h2 className="title">Seus últimos cálculos fatorais.</h2>
17+
18+
{
19+
false &&
20+
<ul className="history">
21+
{
22+
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19].map((item) => (
23+
<li key={String(item)} className="history-item">
24+
<span className="factorial">14</span>
25+
<span className="result">9823823</span>
26+
</li>
27+
))
28+
}
29+
</ul>
30+
}
31+
32+
{
33+
true &&
34+
<p>
35+
Você ainda não realizou nenhum cálculo.
36+
</p>
37+
}
38+
</div>
39+
);
40+
}
41+
42+
export default History;

src/pages/History/styles.scss

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#history-page {
2+
justify-content: normal;
3+
margin: 50px 0px;
4+
height: auto;
5+
width: auto;
6+
}
7+
8+
9+
a {
10+
text-decoration: none;
11+
margin-bottom: 20px;
12+
13+
> div.back {
14+
color: var(--primaryColor);
15+
display: flex;
16+
align-items: center;
17+
18+
span {
19+
margin-left: 5px;
20+
text-transform: uppercase;
21+
font-size: var(--textFontSize);
22+
font-weight: bold;
23+
}
24+
}
25+
}
26+
27+
ul.history {
28+
list-style: none;
29+
padding: 0px;
30+
margin: 0px;
31+
32+
li.history-item {
33+
color: var(--grey3);
34+
background-color: var(--grey6);
35+
width: 100%;
36+
margin-bottom: 10px;
37+
padding: 10px 20px;
38+
display: flex;
39+
align-items: center;
40+
justify-content: space-between;
41+
42+
span.factorial {
43+
font-weight: bold;
44+
font-size: 48px;
45+
46+
&:after {
47+
content: "!";
48+
}
49+
}
50+
51+
span.result {
52+
font-size: 30px;
53+
54+
&:before {
55+
content: "= ";
56+
}
57+
}
58+
}
59+
}

src/pages/Home/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ nav a {
3131
font-size: var(--textFontSize);
3232
text-decoration: none;
3333
position: absolute;
34-
bottom: 50px;
34+
bottom: 10px;
3535
}
3636

3737
@media (min-width: 1000px) {

src/pages/routes.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import React from 'react';
2-
import { BrowserRouter, Route, Switch } from 'react-router-dom';
2+
import { BrowserRouter, Link, Route, Switch } from 'react-router-dom';
33
import { AiFillHeart } from 'react-icons/ai'
44

55
import Home from './Home';
6+
import History from './History';
67

78
import Logo from '../assets/logo.svg';
89
import LogoColored from '../assets/logo-colored.svg';
@@ -11,17 +12,22 @@ const Routes: React.FC = () => {
1112
return (
1213
<BrowserRouter>
1314
<header>
14-
<img src={Logo} alt="Logo" />
15+
<Link to="/">
16+
<img src={Logo} alt="Logo" />
17+
</Link>
1518
<h1 className="title">Faça seus cálculos de fatorial de maneira simples e rápida.</h1>
1619

1720
<p className="author">
1821
Feito com <AiFillHeart /> por Higor Oliveira
1922
</p>
2023
</header>
2124
<div className="router">
22-
<img src={LogoColored} alt="Logo" />
25+
<Link className="logo" to="/">
26+
<img src={LogoColored} alt="Logo" />
27+
</Link>
2328
<Switch>
24-
<Route path="/" component={Home} />
29+
<Route path="/" exact component={Home} />
30+
<Route path="/history" component={History} />
2531
</Switch>
2632
</div>
2733
</BrowserRouter>

0 commit comments

Comments
 (0)