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 committed Oct 6, 2020
1 parent 1152d85 commit 38a1290
Show file tree
Hide file tree
Showing 19 changed files with 13,851 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
draft.md
react-for-everyone.md
component.md
06_Day_Map_List_Keys
06_Day_Map_List_Keys
21 changes: 19 additions & 2 deletions 03_Day_Setting_Up/03_setting_up.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
- [Injecting data to JSX elements](#injecting-data-to-jsx-elements)
- [Importing Media Objects in React](#importing-media-objects-in-react)
- [Exercises](#exercises)
- [Exercises: Level 1](#exercises-level-1)
- [Exercises: Level 2](#exercises-level-2)

# Setting Up

Expand Down Expand Up @@ -734,14 +736,29 @@ The boilerplate code can be found [here](../03/../03_Day_Setting_Up/30-days-of-r

# Exercises

## Exercises: Level 1

1. What is module
2. What is package ?
3. What is the difference between a module and a package
4. What is NPM ?
5. What is Webpack ?
6. How do you create a new React project ?
7. What are these files and folders in a project(package.json, package-lock.json or yarn.lock, .gitignore,node_modules and public )
8. What is your favorite code editor (I believe that it is Visual Studio Code) ?
9. Add different Visual Studio Code extensions to imporve your productivity(eg. prettier, ESLint etc)
10. 6. Try to make different module in a different file and import it to index.js.

## Exercises: Level 2

1. Import and render the following images
![Front end](../images/frontend_technologies.png)

1.Design the following user card.
2.Design the following user card.

![User Card](../images/user_card_design_jsx.png)

1. Use h1, p, input and button HTML element to create the following design using JSX
3. Use h1, p, input and button HTML element to create the following design using JSX

![News Letter](../images/news_letter_design.png)

Expand Down
19 changes: 17 additions & 2 deletions 04_Day_Component/04_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
- [Injecting data to JSX in React Component](#injecting-data-to-jsx-in-react-component)
- [Further on Functional components](#further-on-functional-components)
- [Exercises: Components](#exercises-components)
- [Exercises: Level 1](#exercises-level-1)
- [Exercises: Level 2](#exercises-level-2)

# Components

Expand Down Expand Up @@ -482,8 +484,21 @@ ReactDOM.render(<HexaColor />, rootElement)

# Exercises: Components

1.Create functional components and display the following images
![Front end](../images/frontend_technologies.png)
## Exercises: Level 1

1. What is a React Component ?
2. How do you make a React functional component ?
3. What is the difference between a pure JavaScript function and a functional component ?
4. How small is a React component ?
5. Can we make a button or input field component ?
6. Make a reusable Button component
7. Make a reusable InputField component ?
8. Make a reusable alert box component with one div parent element and one p child element of the div(warning alert box, success alert box)

## Exercises: Level 2

1. Create functional components and display the following images
![Front end](../images/frontend_technologies.png)

2.Use functional component to design the following user card.

Expand Down
16 changes: 14 additions & 2 deletions 05_Day_Props/05_props.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
- [propTypes](#proptypes)
- [defaultProps](#defaultprops)
- [Exercises: Components and Props](#exercises-components-and-props)
- [Exercises: Level 1](#exercises-level-1)
- [Exercises: Level 2](#exercises-level-2)

# Props

Expand Down Expand Up @@ -1065,8 +1067,18 @@ We will cover propTypes in detail in other section.

# Exercises: Components and Props

1.Create functional components and display the following images
![Front end](../images/frontend_technologies.png)
## Exercises: Level 1

1. What is props in a React component ?
2. How do you access props in React component ?
3. What data types can we pass as a props to components ?
4. What is a propTypes
5. What is a default propTypes

## Exercises: Level 2

1. Create functional components and display the following images
![Front end](../images/frontend_technologies.png)

2.Use functional component to design the following user card.

Expand Down
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 38a1290

Please sign in to comment.