Skip to content

Commit

Permalink
feat(custom): #4 Add button, theme colors.
Browse files Browse the repository at this point in the history
  • Loading branch information
pakerchang committed Jun 5, 2023
1 parent 24ee1fc commit 74dddbd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { Box, Flex } from "@chakra-ui/react";
import CustomButton from "./components/shared/Button";

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

interface CustomButtonProps {
interface CustomButtonProps extends ButtonProps {
children: React.ReactNode;
}

function CustomButton({ children }: CustomButtonProps) {
return (
<Button w="180px" h="40px" variant="solid">
<Button w="180px" h="35px" variant="solid">
{children}
</Button>
);
Expand Down
1 change: 0 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App";
import Providers from "./lib/providers";
// import "./styles/index.css";

const mountAssistant = document.createElement("div");
mountAssistant.id = "assistant-root";
Expand Down
15 changes: 14 additions & 1 deletion src/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import { extendTheme } from "@chakra-ui/react";

const theme = extendTheme({});
const config = {
initialColorMode: "light",
useSystemColorMode: false,
};

const theme = extendTheme({
config,
colors: {
primaryBg: "#112D4E",
promptBtn: "#3F72AF",
quickRespBtn: "#DBE2Ef",
settingBtn: "#F9F7F7",
},
});

export default theme;

0 comments on commit 74dddbd

Please sign in to comment.