Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions weather-spa-ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Empty file added weather-spa-ui/README.md
Empty file.
16,807 changes: 16,807 additions & 0 deletions weather-spa-ui/package-lock.json

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions weather-spa-ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "weather-spa-ui",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.1.2",
"@testing-library/user-event": "^12.2.2",
"axios": "^0.21.0",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.0",
"web-vitals": "^0.2.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
39 changes: 39 additions & 0 deletions weather-spa-ui/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Weather Application</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
3 changes: 3 additions & 0 deletions weather-spa-ui/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
12 changes: 12 additions & 0 deletions weather-spa-ui/src/components/footer/Footer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import styles from './Footer.module.css'

const Footer = (props) => {
return (
<div className={styles.footer}>
<p>Created by Kimin Lee</p>
</div>
);
}

export default Footer;
6 changes: 6 additions & 0 deletions weather-spa-ui/src/components/footer/Footer.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.footer{
color: #888888;
border-top: 1px solid #e4e4e4;
margin-top: 16px;
padding: 16px 0;
}
12 changes: 12 additions & 0 deletions weather-spa-ui/src/components/header/Header.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';
import styles from './Header.module.css'

const Header = (props) => {
return (
<div className={styles.header}>
<h1>{props.title}</h1>
</div>
);
}

export default Header;
9 changes: 9 additions & 0 deletions weather-spa-ui/src/components/header/Header.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.header{
margin-top:16px;
margin-bottom: 48px;
}

.header h1{
font-size: 64px;
margin-bottom: 16px;
}
9 changes: 9 additions & 0 deletions weather-spa-ui/src/components/main/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from "react";
import { Route, Switch } from "react-router-dom";
import "./App.css";

const App = () => {
return <div className="App"></div>;
};

export default App;
11 changes: 11 additions & 0 deletions weather-spa-ui/src/components/main/App.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.body{
columns: #333333;
font-family: Arial, Helvetica, sans-serif;
max-width: 650px;
margin: 0 auto;
padding: 0 16px;

display:flex;
flex-direction: column;
min-height:100vh
}
8 changes: 8 additions & 0 deletions weather-spa-ui/src/components/main/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { render, screen } from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
20 changes: 20 additions & 0 deletions weather-spa-ui/src/components/search/Search.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from "react";
import styles from './Search.module.css'

const Search = (props) => {
return (
<div className={styles.main-content}>
<p>Use this site to get your weather!</p>

<form >
<input className={styles.input} placeholder="Location..." />
<button className={styles.button}>Search</button>
</form>

<p id="message-1"></p>
<p id="message-2"></p>
</div>
);
};

export default Search;
17 changes: 17 additions & 0 deletions weather-spa-ui/src/components/search/Search.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.input{
border: 1px solid #cccccc;
padding: 8px;
}

.button{
cursor: pointer;
border:1px solid #888888;
background-color: #888888;
color:white;
padding: 8px;

}

.main-content{
flex-grow:1;
}
16 changes: 16 additions & 0 deletions weather-spa-ui/src/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import reportWebVitals from './reportWebVitals';

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
13 changes: 13 additions & 0 deletions weather-spa-ui/src/reportWebVitals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
};

export default reportWebVitals;
5 changes: 5 additions & 0 deletions weather-spa-ui/src/setupTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';