-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add button component resolves #40 Signed-off-by: Niloy Sikdar <[email protected]>
- Loading branch information
1 parent
8b9462d
commit 55cf6de
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -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> | ||
); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Button } from './Button'; |
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 +1,2 @@ | ||
export * from './Email'; | ||
export * from './Button'; |