From ff58edc98a1224fa24a006b7d5273fbf0c1e2c29 Mon Sep 17 00:00:00 2001 From: Ibrahim Mkusa Date: Tue, 25 Apr 2023 22:29:03 -0400 Subject: ex1.6 --- part1/unicafe/src/App.js | 37 +++++++++++++++++++++++++++++++++++++ part1/unicafe/src/index.js | 6 ++++++ 2 files changed, 43 insertions(+) create mode 100644 part1/unicafe/src/App.js create mode 100644 part1/unicafe/src/index.js (limited to 'part1/unicafe/src') diff --git a/part1/unicafe/src/App.js b/part1/unicafe/src/App.js new file mode 100644 index 0000000..efb32a2 --- /dev/null +++ b/part1/unicafe/src/App.js @@ -0,0 +1,37 @@ +import { useState } from 'react' + +const Button = (props) => { + return ( + + ) +} + +const Display = (props) => { + return ( +

{props.text} {props.count}

+ ) +} + +const App = () => { + // save clicks of each button to its own state + const [good, setGood] = useState(0) + const [neutral, setNeutral] = useState(0) + const [bad, setBad] = useState(0) + + return ( +
+

give feedback

+
+ ) +} + +export default App diff --git a/part1/unicafe/src/index.js b/part1/unicafe/src/index.js new file mode 100644 index 0000000..0c5ea83 --- /dev/null +++ b/part1/unicafe/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