From 08b2a6caac306e18c6bf3596222753bcef25fac0 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sat, 29 Apr 2023 14:25:23 +1000 Subject: [PATCH] exercise 1.5 --- part1/src/App.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/part1/src/App.js b/part1/src/App.js index 2bbce39..29e1e36 100644 --- a/part1/src/App.js +++ b/part1/src/App.js @@ -1,7 +1,7 @@ const Header = (props) => { return (

- {props.course} + {props.course.course}

) } @@ -20,15 +20,15 @@ const Part = (props) => { const Content = (props) => { return ( <> - - - + + + ) } const Total = (props) => { - const total = props.parts[0].exercises + props.parts[1].exercises + props.parts[2].exercises + const total = props.course.parts[0].exercises + props.course.parts[1].exercises + props.course.parts[2].exercises return ( <>

@@ -39,7 +39,7 @@ const Total = (props) => { } const App = () => { - const course = 'Half Stack application development' + const title = 'Half Stack application development' const part1 = { name: 'Fundamentals of React', exercises: 10 @@ -53,12 +53,16 @@ const App = () => { exercises: 14 } const parts = [part1, part2, part3] + const course = { + course: title, + parts: parts + } return (

- - + +
) }