Skip to content

Commit 45dd1cc

Browse files
committed
Added Grommet UI and started doing a mix of the docs walk thru and building the stuff that I need.
1 parent 9a88087 commit 45dd1cc

12 files changed

+917
-42
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,5 @@
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
24+
25+
.env

package-lock.json

+792
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
"@testing-library/jest-dom": "^5.11.9",
77
"@testing-library/react": "^11.2.5",
88
"@testing-library/user-event": "^12.8.3",
9+
"firebase": "^8.3.0",
10+
"grommet": "^2.16.3",
11+
"polished": "^4.1.1",
912
"react": "^17.0.1",
1013
"react-dom": "^17.0.1",
1114
"react-scripts": "4.0.3",
15+
"styled-components": "^5.2.1",
1216
"web-vitals": "^1.1.0"
1317
},
1418
"scripts": {

public/index.html

+27-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<meta name="theme-color" content="#000000" />
8-
<meta
9-
name="description"
10-
content="Web site created using create-react-app"
11-
/>
12-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13-
<!--
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<meta name="theme-color" content="#000000" />
9+
<meta name="description" content="Web site created using create-react-app" />
10+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
11+
<!--
1412
manifest.json provides metadata used when your web app is installed on a
1513
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1614
-->
17-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18-
<!--
15+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
16+
<!--
1917
Notice the use of %PUBLIC_URL% in the tags above.
2018
It will be replaced with the URL of the `public` folder during the build.
2119
Only files inside the `public` folder can be referenced from the HTML.
@@ -24,12 +22,19 @@
2422
work correctly both with client-side routing and a non-root public URL.
2523
Learn how to configure a non-root public URL by running `npm run build`.
2624
-->
27-
<title>React App</title>
28-
</head>
29-
<body>
30-
<noscript>You need to enable JavaScript to run this app.</noscript>
31-
<div id="root"></div>
32-
<!--
25+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
26+
<title>React App</title>
27+
<style type="text/css">
28+
body {
29+
margin: 0;
30+
}
31+
</style>
32+
</head>
33+
34+
<body>
35+
<noscript>You need to enable JavaScript to run this app.</noscript>
36+
<div id="root"></div>
37+
<!--
3338
This HTML file is a template.
3439
If you open it directly in the browser, you will see an empty page.
3540
@@ -39,5 +44,6 @@
3944
To begin the development, run `npm start` or `yarn start`.
4045
To create a production bundle, use `npm run build` or `yarn build`.
4146
-->
42-
</body>
43-
</html>
47+
</body>
48+
49+
</html>

public/logo192.png

-5.22 KB
Binary file not shown.

public/logo512.png

-9.44 KB
Binary file not shown.

src/App.js

+3-20
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
1-
import logo from './logo.svg';
2-
import './App.css';
1+
import "./App.css";
2+
import Home from "./pages/Home";
33

44
function App() {
5-
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>
22-
);
5+
return <Home />;
236
}
247

258
export default App;

src/components/AppBar.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from "react";
2+
import { Box } from "grommet";
3+
4+
const AppBar = (props) => {
5+
return (
6+
<Box
7+
tag="header"
8+
direction="row"
9+
align="center"
10+
justify="between"
11+
background="brand"
12+
pad={{ left: "medium", right: "small", vertical: "small" }}
13+
elevation="medium"
14+
style={{ zIndex: "1" }}
15+
{...props}
16+
></Box>
17+
);
18+
};
19+
20+
export default AppBar;

src/components/MovieSearchCard.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Card, TextInput } from "grommet";
2+
import React from "react";
3+
4+
const MovieSearchCard = () => {
5+
return (
6+
<div>
7+
<Card
8+
height="xsmall"
9+
width="xlarge"
10+
elevation="small"
11+
pad="small"
12+
round="medium"
13+
margin="small"
14+
>
15+
<TextInput placeholder="Movie Title" size="medium" />
16+
</Card>
17+
</div>
18+
);
19+
};
20+
21+
export default MovieSearchCard;

src/logo.svg

-1
This file was deleted.

src/pages/Home.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React, { useState } from "react";
2+
import { Box, Heading, Grommet } from "grommet";
3+
import AppBar from "../components/AppBar";
4+
import MovieSearchCard from "../components/MovieSearchCard";
5+
6+
const theme = {
7+
global: {
8+
colors: {
9+
brand: "#228BE6",
10+
},
11+
font: {
12+
family: "Roboto",
13+
size: "18px",
14+
height: "20px",
15+
},
16+
},
17+
};
18+
19+
const Home = () => {
20+
const [showSidebar, setShowSidebar] = useState(false);
21+
return (
22+
<Grommet theme={theme} full>
23+
<Box fill>
24+
<AppBar>
25+
<Heading level="3" margin="none">
26+
streamStack
27+
</Heading>
28+
</AppBar>
29+
<Box direction="row">
30+
<Box flex align="center" justify="center">
31+
<MovieSearchCard />
32+
</Box>
33+
</Box>
34+
</Box>
35+
</Grommet>
36+
);
37+
};
38+
39+
export default Home;

src/providers/DataProvider.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React, { createContext, useState } from "react";
2+
3+
export const DataContext = createContext();
4+
5+
export const DataProvider = (props) => {
6+
const [searchTerm, setSearchTerm] = useState(null);
7+
const [movies, setMovies] = useState([]);
8+
const [movieDetails, setMovieDetails] = useState(null);
9+
};

0 commit comments

Comments
 (0)