diff --git a/part2/2.1-2.5/src/App.js b/part2/2.1-2.5/src/App.js index 45aede1..76a7543 100644 --- a/part2/2.1-2.5/src/App.js +++ b/part2/2.1-2.5/src/App.js @@ -1,4 +1,5 @@ import React from 'react' +import Course from './components/Course' const App = () => { const courses = [ @@ -53,45 +54,4 @@ const App = () => { ) } -const Course = ({course}) => { - return ( -
{props.part.name} {props.part.exercises}
- ) -} - -const Total = ({part}) => { - const total = part.reduce((sum, p) => sum + p.exercises, 0) - return ( -Total of exercises {total}
- ) -} - export default App \ No newline at end of file diff --git a/part2/2.1-2.5/src/components/Course.js b/part2/2.1-2.5/src/components/Course.js new file mode 100644 index 0000000..979287d --- /dev/null +++ b/part2/2.1-2.5/src/components/Course.js @@ -0,0 +1,44 @@ +import React from 'react'; + +const Course = ({course}) => { + return ( +{props.part.name} {props.part.exercises}
+ ) + } + + const Total = ({part}) => { + const total = part.reduce((sum, p) => sum + p.exercises, 0) + return ( +Total of exercises {total}
+ ) + } + + export default Course \ No newline at end of file