Skip to content

Commit

Permalink
day_5 has been cleaned
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 d9db01b commit 0bb0451
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
21 changes: 18 additions & 3 deletions 05_Day_Props/30-days-of-react_boilerplate-props/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,22 @@ const UserCard = ({ user: { firstName, lastName, image } }) => (

// A button component

const Button = ({ text, onClick }) => <button onClick={onClick}>{text}</button>
const Button = ({ text, onClick, style }) => (
<button style={style} onClick={onClick}>
{text}
</button>
)

const buttonStyles = {
backgroundColor: '#61dbfb',
padding: 10,
border: 'none',
borderRadius: 5,
margin: 3,
cursor: 'pointer',
fontSize: 18,
color: 'white',
}

// Main Component
const Main = ({ user, techs, greetPeople, handleTime }) => (
Expand All @@ -81,8 +96,8 @@ const Main = ({ user, techs, greetPeople, handleTime }) => (
<TechList techs={techs} />
</ul>
<UserCard user={user} />
<Button text='Greet People' onClick={greetPeople} />
<Button text='Show Time' onClick={handleTime} />
<Button text='Greet People' onClick={greetPeople} style={buttonStyles} />
<Button text='Show Time' onClick={handleTime} style={buttonStyles} />
</div>
</main>
)
Expand Down
25 changes: 25 additions & 0 deletions 06_Day_Map_List_Keys/05_map_list_keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div align="center">
<h1> 30 Days Of React: Components </h1>
<a class="header-badge" target="_blank" href="https://www.linkedin.com/in/asabeneh/">
<img src="https://img.shields.io/badge/style--5eba00.svg?label=LinkedIn&logo=linkedin&style=social">
</a>
<a class="header-badge" target="_blank" href="https://twitter.com/Asabeneh">
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/asabeneh?style=social">
</a>

<sub>Author:
<a href="https://www.linkedin.com/in/asabeneh/" target="_blank">Asabeneh Yetayeh</a><br>
<small> October, 2020</small>
</sub>

</div>

[<< Day 3](../30-Days-Of-React/03_Day_Setting_Up/03_day_setting_up.md) | [Day 5 >>](./05_Day_Props/05_props.md)

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

# Mapping lists

Before we jump into mapping an array in React, lets see what we do it in pure JavaScritp.

[<< Day 4](../04_Day_Component/04_components.md) | [Day 6 >>]()

0 comments on commit 0bb0451

Please sign in to comment.