Fix buttons prop types issues in automation
[MAILPOPET-5714]
This commit is contained in:
committed by
Aschepikov
parent
c143da4ccf
commit
ca22a7f37b
@@ -1,13 +1,27 @@
|
||||
import classnames from 'classnames';
|
||||
import { Button as WpButton } from '@wordpress/components';
|
||||
import { ButtonAsAnchorProps } from '@wordpress/components/build-types/button/types';
|
||||
import {
|
||||
ButtonAsAnchorProps,
|
||||
ButtonAsButtonProps,
|
||||
} from '@wordpress/components/src/button/types';
|
||||
import { WordPressComponentProps } from '@wordpress/components/build-types/ui/context';
|
||||
|
||||
type ExtendedProps = {
|
||||
variant: ButtonAsAnchorProps['variant'] | 'sidebar-primary';
|
||||
centered?: boolean;
|
||||
};
|
||||
|
||||
type Props = Omit<ButtonAsAnchorProps, keyof ExtendedProps> & ExtendedProps;
|
||||
type Props =
|
||||
| WordPressComponentProps<
|
||||
Omit<ButtonAsButtonProps, keyof ExtendedProps> & ExtendedProps,
|
||||
'button',
|
||||
false
|
||||
>
|
||||
| WordPressComponentProps<
|
||||
Omit<ButtonAsAnchorProps, keyof ExtendedProps> & ExtendedProps,
|
||||
'a',
|
||||
false
|
||||
>;
|
||||
|
||||
export function Button({ centered, variant, ...props }: Props): JSX.Element {
|
||||
return (
|
||||
|
@@ -2,6 +2,7 @@ import { Dispatch, useCallback, useState } from 'react';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { Button } from '@wordpress/components';
|
||||
import { Hooks } from 'wp-js-hooks';
|
||||
import { ButtonProps } from '@wordpress/components/build-types/button/types';
|
||||
import { PremiumModal } from '../../../common/premium-modal';
|
||||
import { Notice } from '../../../notices/notice';
|
||||
import { FromScratchHookType } from '../../types/filters';
|
||||
@@ -42,7 +43,7 @@ function fromScratchHook(callback: () => void, errorHandler: Dispatch<string>) {
|
||||
}
|
||||
|
||||
type FromScratchButtonProps = {
|
||||
variant?: Button.Props['variant'];
|
||||
variant?: ButtonProps['variant'];
|
||||
};
|
||||
|
||||
export function FromScratchButton({
|
||||
|
Reference in New Issue
Block a user