-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
33 lines (30 loc) · 830 Bytes
/
App.tsx
File metadata and controls
33 lines (30 loc) · 830 Bytes
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
import React, { useContext } from "react";
import styled from "styled-components";
import { RecipeContext } from "./context/index";
import { COLORS } from "./components/Constants";
import SearchBar from "./components/SearchBar";
import RecipeList from "./components/RecipeList";
import Placeholder from "./components/Placeholder";
import Pager from "./components/Pager";
const SearchResult = styled.div`
display: block;
padding: 2rem;
background: ${COLORS.grayLight};
margin: 20px 40px;
border-radius: 4px;
min-height: 600px;
`;
function App() {
const appContext = useContext(RecipeContext);
const { loading } = appContext;
return (
<>
<SearchBar />
<SearchResult>
{loading ? <Placeholder /> : <RecipeList />}
<Pager />
</SearchResult>
</>
);
}
export default App;