Skip to content

Commit

Permalink
Create button icon text component
Browse files Browse the repository at this point in the history
refs #49
  • Loading branch information
franthormel committed Jul 17, 2024
1 parent a9b7536 commit 64de754
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
19 changes: 19 additions & 0 deletions components/buttons/icon-text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { MouseEventHandler } from "react";

export interface ButtonIconTextProps {
text: string;
onClick?: MouseEventHandler;
dataCy?: string;
}

// TODO: Component
// TODO: Design with icon
export default function ButtonIconText(props: ButtonIconTextProps) {
return (
<button className="rounded-full border-2 border-gray-800 bg-slate-50 px-10 py-4 transition-all"
data-cy={props.dataCy ?? "button-icon-text"}
onClick={props.onClick}>
{props.text}
</button>
);
}
17 changes: 17 additions & 0 deletions stories/button-icon-text/ButtonIconText.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import ButtonIconText from "@/components/buttons/icon-text";
import type { Meta, StoryObj } from "@storybook/react";

const meta: Meta<typeof ButtonIconText> = {
title: "Buttons/Icon Text",
component: ButtonIconText,
tags: ["autodocs"],
} satisfies Meta<typeof ButtonIconText>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Example: Story = {
args: {
text: "Base"
}
};

0 comments on commit 64de754

Please sign in to comment.