Skip to content

Commit

Permalink
feat(component): add button
Browse files Browse the repository at this point in the history
add button component

resolves #40

Signed-off-by: Niloy Sikdar <[email protected]>
  • Loading branch information
niloysikdar committed Jun 30, 2022
1 parent 8b9462d commit 55cf6de
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { ReactNode, CSSProperties } from 'react';

export interface ButtonProps {
children?: ReactNode;
variant?: 'primary' | 'secondary';
href: string;
align?: 'left' | 'center' | 'right';
style?: CSSProperties;
}

export const Button = ({
children,
// variant = 'primary',
href,
align = 'center',
style,
}: ButtonProps): JSX.Element => {
return (
<td
align={align}
style={{
padding: '10px 25px',
wordBreak: 'break-word',
}}
>
<a
href={href}
target="_blank"
style={{
fontSize: '18px',
textDecoration: 'none',
padding: '10px 16px',
borderRadius: '5px',
cursor: 'pointer',
...style,
}}
>
{children}
</a>
</td>
);
};
1 change: 1 addition & 0 deletions src/components/Button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Button } from './Button';
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './Email';
export * from './Button';

0 comments on commit 55cf6de

Please sign in to comment.