diff --git a/05_Day_Props/30-days-of-react_boilerplate-props/src/index.js b/05_Day_Props/30-days-of-react_boilerplate-props/src/index.js index 7b19724..2f31110 100644 --- a/05_Day_Props/30-days-of-react_boilerplate-props/src/index.js +++ b/05_Day_Props/30-days-of-react_boilerplate-props/src/index.js @@ -68,8 +68,12 @@ const UserCard = ({ user: { firstName, lastName, image } }) => ( ) +// A button component + +const Button = ({ text, onClick }) => + // Main Component -const Main = ({ user, techs }) => ( +const Main = ({ user, techs, greetPeople, handleTime }) => (

Prerequisite to get started react.js:

@@ -77,6 +81,8 @@ const Main = ({ user, techs }) => ( +
) @@ -101,17 +107,29 @@ const App = () => { firstName: 'Asabeneh', lastName: 'Yetayeh', }, - date: new Date(), + date: new Date(), // date needs to be formatted to a human readable format } const date = new Date() const techs = ['HTML', 'CSS', 'JavaScript'] // copying the author from data object to user variable using spread operator const user = { ...data.author, image: asabenehImage } + const handleTime = () => { + alert(showDate(new Date())) + } + const greetPeople = () => { + alert('Welcome to 30 Days Of React Challenge, 2020') + } + return (
-
+
)