-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented a simple counter app with increment, decrement, and reset…
… functionalities. The design is visually appealing and responsive.
- Loading branch information
1 parent
86c1505
commit e24e2d9
Showing
1 changed file
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
// Update this page (the content is just a fallback if you fail and example) | ||
// Use chakra-ui | ||
import { Container, Text, VStack } from "@chakra-ui/react"; | ||
|
||
// Example of using react-icons | ||
// import { FaRocket } from "react-icons/fa"; | ||
// <IconButton aria-label="Add" icon={<FaRocket />} size="lg" />; // IconButton would also have to be imported from chakra | ||
import { useState } from "react"; | ||
import { Container, Text, VStack, Button, HStack } from "@chakra-ui/react"; | ||
|
||
const Index = () => { | ||
const [count, setCount] = useState(0); | ||
|
||
const increment = () => setCount(count + 1); | ||
const decrement = () => setCount(count - 1); | ||
const reset = () => setCount(0); | ||
|
||
return ( | ||
<Container centerContent maxW="container.md" height="100vh" display="flex" flexDirection="column" justifyContent="center" alignItems="center"> | ||
<VStack spacing={4}> | ||
<Text fontSize="2xl">Your Blank Canvas</Text> | ||
<Text>Chat with the agent to start making edits.</Text> | ||
<Text fontSize="4xl" fontWeight="bold">Counter App</Text> | ||
<Text fontSize="2xl">{count}</Text> | ||
<HStack spacing={4}> | ||
<Button colorScheme="teal" size="lg" onClick={increment}>Increment</Button> | ||
<Button colorScheme="orange" size="lg" onClick={decrement}>Decrement</Button> | ||
<Button colorScheme="red" size="lg" onClick={reset}>Reset</Button> | ||
</HStack> | ||
</VStack> | ||
</Container> | ||
); | ||
}; | ||
|
||
export default Index; | ||
export default Index; |