Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
WIP: add Button component
Browse files Browse the repository at this point in the history
  • Loading branch information
peterleiva committed Dec 22, 2021
1 parent 9138ef3 commit 5a92c16
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/Button.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@use "estileira/common" with ($border-radius: var(--space-xs));

.button {
align-items: center;
background: transparent;
border: common.rem(1) solid var(--gray-2);
border-radius: common.$border-radius;
cursor: pointer;
display: flex;
flex-flow: row nowrap;
gap: var(--space-sm);
justify-content: space-evenly;
padding: var(--space-sm) var(--space-default);
}
19 changes: 19 additions & 0 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { IconType } from "react-icons";
import styles from "./Button.module.scss";

interface ButtonProps extends React.ComponentPropsWithoutRef<"button"> {
Icon?: IconType;
}

export default function Button({
Icon,
children,
...buttonProps
}: ButtonProps) {
return (
<button className={styles.button} {...buttonProps}>
{Icon && <Icon />}
{children}
</button>
);
}
2 changes: 2 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ export { default as NumberFormatCompact } from "./NumberFormatCompact";
export { default as Avatar } from "./avatar";
export { default as Thumbnail, ThumbnailSize } from "./Thumbnail";
export { default as RelativeTime } from "./RelativeTime";
export { default as EmptyState } from "./EmptyState";
export { default as Button } from "./Button";

0 comments on commit 5a92c16

Please sign in to comment.