diff --git a/web/src/App.css b/web/src/App.css index 278c10b..4539e6c 100644 --- a/web/src/App.css +++ b/web/src/App.css @@ -26,6 +26,8 @@ } } -.card { +.dualColumns { padding: 2em; + display: flex; + align-items: center; } diff --git a/web/src/IncrementButton.tsx b/web/src/IncrementButton.tsx deleted file mode 100644 index a1697f1..0000000 --- a/web/src/IncrementButton.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { useState } from 'react'; - -type ComponentProps = { - incrementBy: number; -}; - -function IncrementButton(props: ComponentProps) { - const [count, setCount] = useState(0); - - return ( -
- -
- ); -} - -export default IncrementButton; diff --git a/web/src/components/IncrementButton.tsx b/web/src/components/IncrementButton.tsx new file mode 100644 index 0000000..f1f4c77 --- /dev/null +++ b/web/src/components/IncrementButton.tsx @@ -0,0 +1,13 @@ +import { Dispatch } from 'react'; + +function IncrementButton(props: { countIncrease: Dispatch, incrementBy: number}) { + return ( +
+ +
+ ); +} + +export default IncrementButton; diff --git a/web/src/components/SnakeScreen.tsx b/web/src/components/SnakeScreen.tsx index 17e9bde..8db6a90 100644 --- a/web/src/components/SnakeScreen.tsx +++ b/web/src/components/SnakeScreen.tsx @@ -1,18 +1,30 @@ -import IncrementButton from '../IncrementButton'; +import IncrementButton from './IncrementButton'; import CanvasBoard from './CanvasBoard'; +import { useState } from 'react'; function SnakeScreen() { - return ( -
-
🐍
-

GDSC Snake

-
- - - -
+ const [count, setCount] = useState(0); + + function increaseCount(incrementNum: number) { + setCount(count + incrementNum); + } + + return ( +
+
🐍
+

GDSC Snake

+
+
+ +
+
+

Current score: {count}

+ +
- ); +
+
+ ); } export default SnakeScreen;