Button.js
2 months ago
Checklist.js
2 months ago
Image.js
2 months ago
Link.js
2 months ago
List.js
2 months ago
Paragraph.js
2 months ago
RenderContent.js
2 months ago
Video.js
2 months ago
Button.js
23 lines
| 1 | import { Button as FUIButton } from '@bsf/force-ui'; |
| 2 | import { forwardRef } from '@wordpress/element'; |
| 3 | |
| 4 | const Button = ( { text, variant, onClick } ) => { |
| 5 | const handleOnClick = ( event ) => { |
| 6 | if ( !! onClick && typeof onClick === 'function' ) { |
| 7 | onClick( event ); |
| 8 | } |
| 9 | }; |
| 10 | |
| 11 | return ( |
| 12 | <FUIButton |
| 13 | variant={ variant || 'primary' } |
| 14 | size="sm" |
| 15 | onClick={ handleOnClick } |
| 16 | > |
| 17 | { text } |
| 18 | </FUIButton> |
| 19 | ); |
| 20 | }; |
| 21 | |
| 22 | export default forwardRef( Button ); |
| 23 |