PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / Views / Components / AdminUI / Button / index.tsx

index.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.16.9, at src/Views/Components/AdminUI/Button/index.tsx

35 lines 876 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {forwardRef, MouseEventHandler, ReactNode} from 'react';
2 import cx from 'classnames';
3 import './style.scss';
4
5 /**
6 *
7 * @since 3.0.0
8 */
9 export type ButtonProps = {
10 variant?: 'primary' | 'secondary' | 'danger';
11 size?: 'small' | 'large';
12 type?: 'button' | 'reset' | 'submit';
13 children: ReactNode;
14 onClick?: MouseEventHandler;
15 disabled?: boolean;
16 className?: string;
17 [x: string]: any;
18 };
19
20 const Button = forwardRef<HTMLButtonElement, ButtonProps>(
21 ({children, type = 'button', variant = 'primary', size = 'small', disabled = false, className, ...props}, ref) => (
22 <button
23 ref={ref}
24 disabled={disabled}
25 type={type}
26 className={cx('givewp-button', variant, size, className)}
27 {...props}
28 >
29 {children}
30 </button>
31 )
32 );
33
34 export default Button;
35