day_5 has been cleaned

pull/53/head
Asabeneh 4 years ago committed by momin-riyadh
parent d9db01b82c
commit 0bb04517d6

@ -70,7 +70,22 @@ const UserCard = ({ user: { firstName, lastName, image } }) => (
// A button component // 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 // Main Component
const Main = ({ user, techs, greetPeople, handleTime }) => ( const Main = ({ user, techs, greetPeople, handleTime }) => (
@ -81,8 +96,8 @@ const Main = ({ user, techs, greetPeople, handleTime }) => (
<TechList techs={techs} /> <TechList techs={techs} />
</ul> </ul>
<UserCard user={user} /> <UserCard user={user} />
<Button text='Greet People' onClick={greetPeople} /> <Button text='Greet People' onClick={greetPeople} style={buttonStyles} />
<Button text='Show Time' onClick={handleTime} /> <Button text='Show Time' onClick={handleTime} style={buttonStyles} />
</div> </div>
</main> </main>
) )

@ -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 >>]()
Loading…
Cancel
Save