Skip to content

Commit

Permalink
improve landing hero
Browse files Browse the repository at this point in the history
  • Loading branch information
souhaib-benbouzid committed Jan 8, 2024
1 parent 39f747b commit 0a98c31
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 830 deletions.
17 changes: 15 additions & 2 deletions packages/ui/src/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BaseUIProps, ChildrenProp } from "src/_types";
import { Link } from "src/link";

export interface ButtonProps extends BaseUIProps, ChildrenProp {
variant: "v1" | "v2" | "v3";
variant: "v1" | "v2" | "v3" | "v4";
onClick?: (event: MouseEvent<HTMLElement>) => void;
href?: string;
}
Expand All @@ -16,12 +16,25 @@ const variantToMUIButtonVariant: Record<
> = {
v2: "text",
v3: "contained",
v4: "outlined",
};

export const Button: FC<ButtonProps> = ({ children, variant, margin, ...props }) => {
const { toCSSMargin } = useTheme();

switch (variant) {
case "v4":
return (
<MUIButton
sx={{ margin: toCSSMargin(margin), textTransform: "capitalize" }}
{...props}
variant="outlined"
LinkComponent={Link}
>
{children}
</MUIButton>
);

case "v1":
return (
<Link {...props} variant="v2" margin={margin}>
Expand All @@ -32,7 +45,7 @@ export const Button: FC<ButtonProps> = ({ children, variant, margin, ...props })
default:
return (
<MUIButton
sx={{ margin: toCSSMargin(margin) }}
sx={{ margin: toCSSMargin(margin), textTransform: "capitalize" }}
{...props}
variant={variantToMUIButtonVariant[variant]}
LinkComponent={Link}
Expand Down
Loading

0 comments on commit 0a98c31

Please sign in to comment.