Restructure folder and completed 1.6

This commit is contained in:
2021-08-26 20:02:05 +07:00
parent 6fac642921
commit 5e749f4448
39 changed files with 38694 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import React, { useState } from 'react'
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 (
<div>
<h1>Give feedback</h1>
<button onClick={() => setGood(good + 1)}>good</button>
<button onClick={() => setNeutral(neutral + 1)}>neutral</button>
<button onClick={() => setBad(bad + 1)}>bad</button>
<h1>Statistic</h1>
<p>Good: {good}</p>
<p>Neutral: {neutral}</p>
<p>Bad: {bad}</p>
</div>
)
}
export default App
+13
View File
@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
+7
View File
@@ -0,0 +1,7 @@
import ReactDOM from 'react-dom'
import App from './App'
ReactDOM.render(
<App />,
document.getElementById('root')
)