Skip to content

Commit

Permalink
feat(custom): #4 add button componment.
Browse files Browse the repository at this point in the history
  • Loading branch information
pakerchang committed Jun 5, 2023
1 parent 875347d commit 24ee1fc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "gpt-assistant",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
Expand Down
9 changes: 7 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { Box, Flex } from "@chakra-ui/react";
import CustomButton from "./components/shared/Button";

function App() {
return (
<Box pos="fixed" zIndex={100} right={0} top={0} w="200px" h="90vh" mt="15px">
<Flex flexDirection="column" justifyContent="center"></Flex>
<Box pos="fixed" zIndex={100} top={50} right={0} w="200px" h="90vh" mr="15px">
<Box>Drawer</Box>
<Flex h="100%" flexDirection="column" alignItems="center" justifyContent="space-around" borderRadius="15px" bgColor="blue.100">
<CustomButton>Testing</CustomButton>
<CustomButton>Testing</CustomButton>
</Flex>
</Box>
);
}
Expand Down
15 changes: 15 additions & 0 deletions src/components/shared/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Button } from "@chakra-ui/react";

interface CustomButtonProps {
children: React.ReactNode;
}

function CustomButton({ children }: CustomButtonProps) {
return (
<Button w="180px" h="40px" variant="solid">
{children}
</Button>
);
}

export default CustomButton;

0 comments on commit 24ee1fc

Please sign in to comment.