Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1403d0b

Browse files
committed
filters, api, single pages using routing
1 parent d34e1da commit 1403d0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2275
-123
lines changed

‎package-lock.json‎

Lines changed: 856 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@
66
"@testing-library/jest-dom": "^5.16.5",
77
"@testing-library/react": "^13.4.0",
88
"@testing-library/user-event": "^13.5.0",
9+
"axios": "^1.3.4",
10+
"dompurify": "^3.0.1",
911
"react": "^18.2.0",
1012
"react-dom": "^18.2.0",
13+
"react-loader-spinner": "^5.3.4",
14+
"react-router-dom": "^6.8.2",
1115
"react-scripts": "5.0.1",
16+
"react-select": "^5.7.0",
17+
"sass": "^1.58.3",
18+
"swiper": "^9.1.0",
1219
"web-vitals": "^2.1.4"
1320
},
1421
"scripts": {

‎public/favicon.ico‎

-3.78 KB
Binary file not shown.

‎public/logo192.png‎

-5.22 KB
Binary file not shown.

‎public/logo512.png‎

-9.44 KB
Binary file not shown.

‎public/manifest.json‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎public/robots.txt‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎src/API/GamesAPI.jsx‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import axios from "axios";
2+
3+
export default class GamesAPI {
4+
static async getGamesList() {
5+
const response = await axios.get('https://api.rawg.io/api/games?key=2e30963c61f74dac97f2c89f3b62186e');
6+
return response;
7+
}
8+
9+
static async getGameById(id) {
10+
const response = await axios.get(`https://api.rawg.io/api/games/${id}?key=2e30963c61f74dac97f2c89f3b62186e`);
11+
return response;
12+
}
13+
14+
static async getGameScreenshotsById(id) {
15+
const response = await axios.get(`https://api.rawg.io/api/games/${id}/screenshots?key=2e30963c61f74dac97f2c89f3b62186e`);
16+
return response;
17+
}
18+
19+
static async getGameAchiviementsById(id) {
20+
const response = await axios.get(`https://api.rawg.io/api/games/${id}/achievements?key=2e30963c61f74dac97f2c89f3b62186e`);
21+
return response;
22+
}
23+
}

‎src/App.css‎

Lines changed: 94 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,105 @@
1-
.App {
2-
text-align: center;
1+
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,500;0,700;0,900;1,400;1,500;1,700;1,900&display=swap');
2+
3+
body {
4+
font-family: 'Roboto', sans-serif;
5+
color: #fff;
6+
background-color: #151515;
7+
}
8+
9+
* {
10+
padding: 0px;
11+
margin: 0px;
12+
border: none;
13+
}
14+
15+
*,
16+
*::before,
17+
*::after {
18+
box-sizing: border-box;
19+
}
20+
21+
a, a:link, a:visited {
22+
color: inherit;
23+
text-decoration: none;
24+
}
25+
26+
27+
aside, nav, footer, header, section, main {
28+
display: block;
29+
}
30+
31+
h1, h2, h3, h4, h5, h6, p {
32+
font-size: inherit;
33+
font-weight: inherit;
34+
}
35+
36+
ul, ul li {
37+
list-style: none;
38+
}
39+
40+
img {
41+
vertical-align: top;
42+
}
43+
44+
img, svg {
45+
max-width: 100%;
46+
height: auto;
47+
}
48+
49+
address {
50+
font-style: normal;
51+
}
52+
53+
input, textarea, button, select {
54+
font-family: inherit;
55+
font-size: inherit;
56+
color: inherit;
57+
background-color: transparent;
58+
}
59+
60+
input::-ms-clear {
61+
display: none;
62+
}
63+
64+
button, input[type="submit"] {
65+
display: inline-block;
66+
box-shadow: none;
67+
background-color: transparent;
68+
background: none;
69+
cursor: pointer;
70+
}
71+
72+
input:focus, input:active,
73+
button:focus, button:active {
74+
outline: none;
75+
}
76+
77+
button::-moz-focus-inner {
78+
padding: 0;
79+
border: 0;
380
}
481

5-
.App-logo {
6-
height: 40vmin;
7-
pointer-events: none;
82+
label {
83+
cursor: pointer;
884
}
985

10-
@media (prefers-reduced-motion: no-preference) {
11-
.App-logo {
12-
animation: App-logo-spin infinite 20s linear;
13-
}
86+
legend {
87+
display: block;
1488
}
1589

16-
.App-header {
17-
background-color: #282c34;
18-
min-height: 100vh;
19-
display: flex;
20-
flex-direction: column;
21-
align-items: center;
22-
justify-content: center;
23-
font-size: calc(10px + 2vmin);
24-
color: white;
90+
.container {
91+
max-width: 1440px;
92+
width: 100%;
93+
margin: 0 auto;
2594
}
2695

27-
.App-link {
28-
color: #61dafb;
96+
.section-header {
97+
margin-top: 10px;
98+
margin-bottom: 10px;
2999
}
30100

31-
@keyframes App-logo-spin {
32-
from {
33-
transform: rotate(0deg);
34-
}
35-
to {
36-
transform: rotate(360deg);
37-
}
101+
.section-title {
102+
font-size: 28px;
103+
font-weight: 700;
104+
text-align: center;
38105
}

‎src/App.js‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
import logo from './logo.svg';
1+
import { useState, useEffect } from 'react';
2+
import { BrowserRouter, Route, Routes } from "react-router-dom";
3+
4+
25
import './App.css';
6+
import MainPage from './pages/MainPage/MainPage';
7+
import GamePage from './pages/GamePage/GamePage';
38

49
function App() {
10+
511
return (
6-
<div className="App">
7-
<header className="App-header">
8-
<img src={logo} className="App-logo" alt="logo" />
9-
<p>
10-
Edit <code>src/App.js</code> and save to reload.
11-
</p>
12-
<a
13-
className="App-link"
14-
href="https://reactjs.org"
15-
target="_blank"
16-
rel="noopener noreferrer"
17-
>
18-
Learn React
19-
</a>
20-
</header>
21-
</div>
12+
<BrowserRouter>
13+
<div className="App">
14+
<Routes>
15+
<Route path="/" element={<MainPage/>}/>
16+
<Route path="/games/:id" element={<GamePage/>}/>
17+
</Routes>
18+
</div>
19+
</BrowserRouter>
2220
);
2321
}
2422

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /