Adding Styled Overridable button for video example

This commit is contained in:
saman 2021-12-19 12:49:30 -05:00
parent ac25f55dc2
commit 0092c02523
3 changed files with 26 additions and 0 deletions

24
src/components/Button.tsx Normal file
View File

@ -0,0 +1,24 @@
import React from 'react';
export interface IButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
backgroundColor?: string;
color?: string;
style?: React.CSSProperties;
}
export const Button: React.FunctionComponent<IButtonProps> = (props) => {
const { children, backgroundColor, style } = props;
return (
<button
style={{
...style,
backgroundColor: backgroundColor || 'black',
color: 'white'
}}
{...props}
>
{children}
</button>
);
};

1
src/components/index.ts Normal file
View File

@ -0,0 +1 @@
export * from './Button';

View File

@ -1,2 +1,3 @@
export * from './hooks';
export * from './library';
export * from './components';