diff --git a/index.html b/index.html index 62cb9bc4f..39b872ded 100644 --- a/index.html +++ b/index.html @@ -9,5 +9,6 @@
+ diff --git a/package-lock.json b/package-lock.json index d6b5fd56a..a87d148a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,9 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", "vite": "^5.2.0" + }, + "engines": { + "node": ">=20.0.0" } }, "node_modules/@eslint-community/eslint-utils": { diff --git a/src/js/components/SecondsCounter.jsx b/src/js/components/SecondsCounter.jsx new file mode 100644 index 000000000..970d305ab --- /dev/null +++ b/src/js/components/SecondsCounter.jsx @@ -0,0 +1,26 @@ + +const Digit = (props) => { + return ( +
+ {props.number} +
+ ) +} + +const SecondsCounter = (props) => { + return ( +
+
+ +
+ + + + + + +
+ ) +} + +export default SecondsCounter; \ No newline at end of file diff --git a/src/js/main.jsx b/src/js/main.jsx index 14662105b..70df4684f 100644 --- a/src/js/main.jsx +++ b/src/js/main.jsx @@ -9,10 +9,26 @@ import "bootstrap" import '../styles/index.css' // components -import Home from './components/Home'; -ReactDOM.createRoot(document.getElementById('root')).render( +import SecondsCounter from './components/SecondsCounter'; + +let counter = 0; +const root = ReactDOM.createRoot(document.getElementById('root')) + +setInterval(() => { + counter += 1; + root.render( + + + +) +}, 1000) + + +root.render( - - , + + ) + +