Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future weather #10 #24

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
21e80e2
upgrade to react 18 + sass
SallyMcGrath Jan 30, 2023
db71448
strip unwanted files, add missing test files
SallyMcGrath Jan 30, 2023
156a8b4
add .env example
SallyMcGrath Jan 30, 2023
97ff92a
swap npm for yarn
SallyMcGrath Jan 30, 2023
83668e2
stub a simple sass theme
SallyMcGrath Jan 30, 2023
a4a205d
stub example components
SallyMcGrath Jan 30, 2023
1eb1a44
tweak head, ready for dev
SallyMcGrath Jan 30, 2023
b06a700
mistakenly renamed App.js
SallyMcGrath Jan 30, 2023
fca9249
rm git add, format code
SallyMcGrath Feb 3, 2023
9ce3280
Merge remote-tracking branch 'origin/master'
SallyMcGrath Feb 3, 2023
6ef5b18
link to google fonts cdn
SallyMcGrath Feb 4, 2023
468bb68
assign Raleway to font variable
SallyMcGrath Feb 4, 2023
4f64c2f
rename font variable to theme-font
SallyMcGrath Feb 4, 2023
87d25de
Merge pull request #3 from CodeYourFuture/feature/type
Emeka1993 Feb 4, 2023
f85833a
spacing sizes
SallyMcGrath Feb 4, 2023
0c70408
add JSON file with sample data
LucyMac Feb 4, 2023
d43bda8
Merge pull request #20 from CodeYourFuture/sample-json-data-14
LucyMac Feb 4, 2023
20834d1
Header Done
Emeka1993 Feb 4, 2023
ac7ffc6
Updated Header
Emeka1993 Feb 4, 2023
898d462
adding img
Nikolov87 Feb 4, 2023
c3d2c75
Merge pull request #13 from CodeYourFuture/feature/spacing
zkhing Feb 4, 2023
80162d0
Header
Emeka1993 Feb 4, 2023
ce2104b
created Future weather component
Lunamzelo Feb 4, 2023
24bd4b4
added future weather style
Lunamzelo Feb 4, 2023
29cfdbe
rendered the future weather component
Lunamzelo Feb 4, 2023
906cd43
Deleted package lock json
Emeka1993 Feb 4, 2023
0024a0c
Delete yarn.lock
SallyMcGrath Feb 4, 2023
e6d62df
Merge pull request #21 from Emeka1993/feature/header
SallyMcGrath Feb 4, 2023
33a51da
re-add yarn lock
SallyMcGrath Feb 4, 2023
a27a41e
Merge pull request #26 from CodeYourFuture/replace-yarn-lock
youweb3 Feb 4, 2023
eecdaf8
adding icon fiel
Nikolov87 Feb 4, 2023
2ba732b
Update yarn.lock
Nikolov87 Feb 4, 2023
ab60c21
Merge pull request #27 from CodeYourFuture/eature/images
Nikolov87 Feb 6, 2023
eabce48
Merge branch 'master' into future-weather
LucyMac Feb 25, 2023
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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Please **fork** and **clone** this repository. There are instructions for how t
Then navigate to the correct directory using the command line.

Once you're in the project directory, you can run:
```
```bash
npm install

npm start
Expand All @@ -21,8 +21,8 @@ Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Edit `App.js` and add a tiny change, like adding your name, to see if the change appears.

Add and commit this change to git, and push it up to your remote github repo:
```
git add .
```git
git add App.js
git commit -m "Added my name to the app"
git push
```
Expand Down Expand Up @@ -60,12 +60,12 @@ There is a special way to show images from a React app created with create-react

At the top of your component, import the image like this (remember to give it a name!)

```
```javascript
import storm from '../img/weather-icons/storm.svg';
```

Then later in your `<img/>` tag, use the imported value as the image source, like this:
```
```html
<img src={storm} alt="storm icon" />
```

Expand Down Expand Up @@ -100,7 +100,7 @@ Copy all contents into a new file and add it to your project somewhere under the

Import it into your react app with

```
```javascript
import FakeWeatherData from "./data/FakeWeather.json";
```

Expand All @@ -115,7 +115,7 @@ This JSON represents weather data for **just one city**.
It includes **an array called `list` containing the weather predicitons for the next 5 days, split into 8 x 3-hour chunks**
Each object inside `list` contains a `weather` array with an object that looks like this:

```
```json
"weather": [
{
"id": 521,
Expand Down Expand Up @@ -169,7 +169,7 @@ Look at the design:

- Each object inside `list` contains a `weather` array with an object that looks like this:

```
```json
"weather": [
{
"id": 521,
Expand Down
6 changes: 6 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>CYF Weather App</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;500&display=swap"
rel="stylesheet"
/>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
4 changes: 4 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import "./App.scss";
import Header from "./components/Header/Header";
import Footer from "./components/Footer/Footer";
import FutureWeather from "./components/FutureWeather/FutureWeather";


//configs
const siteTitle = process.env.REACT_APP_SITE_TITLE ?? "CYF Weather";
Expand All @@ -10,7 +12,9 @@ function App() {
<div className="App">
<Header title={siteTitle} />
<main className="c-site-main" tabIndex="0">
<FutureWeather weatherArray={[1, 2, 3, 4, 5, 6, 7]} />
</main>

<Footer />
</div>
);
Expand Down
14 changes: 14 additions & 0 deletions src/components/FutureWeather/FutureWeather.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import "./FutureWeather.scss"


const FutureWeather = ({weatherArray}) => {

return(
<ul>
{weatherArray.map((weather) => <li>{weather} </li>)}
</ul>
)
};

export default FutureWeather;
8 changes: 8 additions & 0 deletions src/components/FutureWeather/FutureWeather.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ul {
display: flex;
justify-content: space-between;
padding: var(--theme-spacing--6);
}
li {
list-style: none;
}
Loading