From 864c74dd1ac16274694aee4c0d2f5b52cebef246 Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Sat, 22 Apr 2023 22:13:22 -0400 Subject: Did exercises 1.1-1.2 --- part1/courseinfo/src/App.js | 41 +++++++++++++++++++++++++++++++++++++++++ part1/courseinfo/src/index.js | 6 ++++++ 2 files changed, 47 insertions(+) create mode 100644 part1/courseinfo/src/App.js create mode 100644 part1/courseinfo/src/index.js (limited to 'part1/courseinfo/src') diff --git a/part1/courseinfo/src/App.js b/part1/courseinfo/src/App.js new file mode 100644 index 0000000..35bb178 --- /dev/null +++ b/part1/courseinfo/src/App.js @@ -0,0 +1,41 @@ +const Header = (props) => { + return ( +

{props.name}

+ ) +} + +const Part = (props) => { + return ( +

+ {props.part} {props.desc} +

+ ) +} + +const Total = (props) => { + return ( +

Number of exercises {props.one + props.two + props.three}

+ ) +} + +const App = () => { + const course = 'Half Stack application development' + const part1 = 'Fundamentals of React' + const exercises1 = 10 + const part2 = 'Using props to pass data' + const exercises2 = 7 + const part3 = 'State of a component' + const exercises3 = 14 + + return ( +
+
+ + + + +
+ ) +} + +export default App diff --git a/part1/courseinfo/src/index.js b/part1/courseinfo/src/index.js new file mode 100644 index 0000000..a9e69b3 --- /dev/null +++ b/part1/courseinfo/src/index.js @@ -0,0 +1,6 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; + +import App from './App'; + +ReactDOM.createRoot(document.getElementById('root')).render(); -- cgit v1.2.3