-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathApp.js
More file actions
69 lines (60 loc) · 1.9 KB
/
App.js
File metadata and controls
69 lines (60 loc) · 1.9 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import React, { useContext, useState } from "react";
import "./App.css";
import "bootstrap/dist/css/bootstrap.min.css";
//Context
import { ThemeContext } from "./Context/themeContext";
//Components
import Header from "./components/Header";
import CardSet from "./components/CardSet";
import Navigation from "./components/Navigation";
function App() {
const [language, setLanguage] = useState("Javascript");
const [pageNumber, setPageNumber] = useState(1);
const [maxPageNumber, setMaxPageNumber] = useState(100);
const [inputSearch, setInputSearch] = useState("");
const [sortByForks, setSortByForks] = useState("desc");
const [sortByStars, setSortByStars] = useState("desc");
const [reducedState, setReducedState] = useState({
minForks: "",
maxForks: "",
minStars: "",
maxStars: "",
});
const [hidePagination, setHidePagination] = useState(true);
const { theme } = useContext(ThemeContext);
return (
<div
className="App"
style={{ backgroundColor: theme.bg, color: theme.color }}
>
<Header
language={language}
setLanguage={setLanguage}
setInputSearch={setInputSearch}
/>
<CardSet
pageNumber={pageNumber}
language={language}
key={language + pageNumber}
setMaxPageNumber={setMaxPageNumber}
sortByForks={sortByForks}
sortByStars={sortByStars}
reducedState={reducedState}
setReducedState={setReducedState}
inputSearch={inputSearch}
setHidePagination={setHidePagination}
/>
<Navigation
pageNumber={pageNumber}
maxPageNumber={maxPageNumber}
setPageNumber={setPageNumber}
setSortByForks={setSortByForks}
setSortByStars={setSortByStars}
reducedState={reducedState}
setReducedState={setReducedState}
hidePagination={hidePagination}
/>
</div>
);
}
export default App;