-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
13 deletions.
There are no files selected for viewing
17 changes: 7 additions & 10 deletions
17
pkgs/frontend/app/components/button.tsx → .../frontend/app/components/CommonButton.tsx
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,35 +1,32 @@ | ||
import { | ||
Button as ChakraButton, | ||
ButtonProps as ChakraButtonProps, | ||
} from "@chakra-ui/react"; | ||
import { Button, ButtonProps } from "@chakra-ui/react"; | ||
|
||
interface ButtonProps extends Omit<ChakraButtonProps, "width"> { | ||
interface CommonButtonProps extends Omit<ButtonProps, "width"> { | ||
children: React.ReactNode; | ||
width?: "full" | number; | ||
size?: "sm" | "md" | "lg"; | ||
backgroundColor?: string; | ||
color?: string; | ||
} | ||
|
||
export const Button = ({ | ||
export const CommonButton = ({ | ||
children, | ||
width = "full", | ||
size = "md", | ||
backgroundColor, | ||
color, | ||
...props | ||
}: ButtonProps) => { | ||
}: CommonButtonProps) => { | ||
return ( | ||
<ChakraButton | ||
<Button | ||
w={width === "full" ? "100%" : width} | ||
size={size} | ||
backgroundColor={backgroundColor} | ||
color={color} | ||
{...props} | ||
> | ||
{children} | ||
</ChakraButton> | ||
</Button> | ||
); | ||
}; | ||
|
||
export default Button; | ||
export default CommonButton; |
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