Adding Styled Overridable button for video example
This commit is contained in:
parent
ac25f55dc2
commit
0092c02523
24
src/components/Button.tsx
Normal file
24
src/components/Button.tsx
Normal 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
1
src/components/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './Button';
|
@ -1,2 +1,3 @@
|
||||
export * from './hooks';
|
||||
export * from './library';
|
||||
export * from './components';
|
||||
|
Loading…
x
Reference in New Issue
Block a user