Skip to content

Commit

Permalink
Day_7 has been published
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh authored and momin-riyadh committed Oct 8, 2020
1 parent ec74376 commit 1d48771
Show file tree
Hide file tree
Showing 14 changed files with 13,201 additions and 27 deletions.
67 changes: 40 additions & 27 deletions 06_Day_Map_List_Keys/05_map_list_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

</div>

[<< Day 5](./../05_Day_Props/05_props.md) | [Day 7 >>]()
[<< Day 5](./../05_Day_Props/05_props.md) | [Day 7 >>](../07_Day_Class_Components/07_class_components.md)

![30 Days of React banner](../images/30_days_of_react_banner_day_6.jpg)

Expand All @@ -25,6 +25,8 @@
- [Mapping array of objects](#mapping-array-of-objects)
- [Key in mapping arrays](#key-in-mapping-arrays)
- [Exercises](#exercises)
- [Exercises: Level 1](#exercises-level-1)
- [Exercises: Level 1](#exercises-level-1-1)

# Mapping arrays

Expand Down Expand Up @@ -97,37 +99,37 @@ Let's see how to map array of arrays
import React from 'react'
import ReactDOM from 'react-dom'

const skills = [
['HTML', 10],
['CSS', 7],
['JavaScript', 9],
['React', 8],
]

// Skill Component
const Skill = ({ skill: [tech, level] }) => (
<li>
{tech} {level}
</li>
)
const skills = [
['HTML', 10],
['CSS', 7],
['JavaScript', 9],
['React', 8],
]

// Skill Component
const Skill = ({ skill: [tech, level] }) => (
<li>
{tech} {level}
</li>
)

// Skills Component
const Skills = ({ skills }) => {
const skillsList = skills.map((skill) => <Skill skill={skill} />)
console.log(skillsList)
return <ul>{skillsList}</ul>
}
// Skills Component
const Skills = ({ skills }) => {
const skillsList = skills.map((skill) => <Skill skill={skill} />)
console.log(skillsList)
return <ul>{skillsList}</ul>
}

const App = () => {
return (
const App = () => {
return (
<div className='container'>
<div>
<h1>Skills Level</h1>
<Skills skills={skills} />
</div>
</div>
)
}
}

const rootElement = document.getElementById('root')
ReactDOM.render(<App />, rootElement)
Expand Down Expand Up @@ -257,16 +259,27 @@ ReactDOM.render(<App />, rootElement)

# Exercises

1. In the following design, evens are green, odds are yellow and prime numbers are red.
## Exercises: Level 1

1. Why you need to map an array ?
2. Why we need keys during mapping an array ?
3. What is the importance of destructuring your code ?
4. Does destructuring make your code clean and easy to read ?

## Exercises: Level 1

1. In the following design, evens are green, odds are yellow and prime numbers are red. Build the following colors using React component

![Number Generator](../images/day_6_number_generater_exercise.png)

2. Create the following hexadecimal colors
2. Create the following hexadecimal colors using React component

![Number Generator](../images/day_6_hexadecimal_colors_exercise.png)

3. ![Ten most highest populations](../images/day_6_ten_highest_populations_exercise.png)
3.Make the following bar group using given [data](../06_Day_Map_List_Keys/06_map_list_keys_boilerplate/src/data/ten_most_highest_populations.js)

![Ten most highest populations](../images/day_6_ten_highest_populations_exercise.png)

🎉 CONGRATULATIONS ! 🎉

[<< Day 5](./../05_Day_Props/05_props.md) | [Day 7 >>]()
[<< Day 5](./../05_Day_Props/05_props.md) | [Day 7 >>](../07_Day_Class_Components/07_class_components.md)
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*
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 30 Days of React App: Day 3

In the project directory, you can run to start the project

### `npm start`
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "30-days-of-react",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500|Roboto:300,400,500&display=swap"
rel="stylesheet"
/>
<meta
name="description"
content="Web site created using create-react-app"
/>

<title>30 Days Of React App</title>
<style>

/* == General style === */

* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

html,
body {
height: 100%;
line-height: 1.5;
font-family: 'Montserrat';
font-weight: 300;
color: black;
}

.root {
min-height: 100%;
position: relative;
}

.header-wrapper,
.main-wrapper,
.footer-wrapper {
width: 85%;
margin: auto;
}

.header-wrapper,
.main-wrapper {
padding: 10px;
margin: 2px auto;
}

h1 {
font-size: 70px;
font-weight: 300;
}

h2,
h3 {
font-weight: 300;
}

header {
background-color: #61dbfb;
padding: 25;
padding: 10px;
}

main {
padding: 10px;
padding-bottom: 60px;
/* Height of the footer */
}

ul {
margin-left: 15px;
}

ul li {
list-style: none;
}

footer {
position: absolute;
bottom: 0;
width: 100%;
height: 60px;
/* Height of the footer */
background: #6cf;
}

.footer-wrapper {
font-weight: 400;
text-align: center;
line-height: 60px;
}
.user-card {
margin-top: 10px;
}
.user-card > img {
border-radius: 50%;
width: 14%;
}

</style>

</head>
<body>
<div id="root"></div>
</body>
</html>
Loading

0 comments on commit 1d48771

Please sign in to comment.