Skip to content

Commit

Permalink
fix: improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
kark committed Jan 10, 2025
1 parent 340aab3 commit aea946e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { ReactElement, SyntheticEvent, ReactNode } from 'react';
import { css } from '@emotion/react';
import { useIntl, type IntlShape } from 'react-intl';
import { designTokens as uiKitDesignTokens } from '@commercetools-uikit/design-system';
import type { TIconProps } from '@commercetools-uikit/design-system';
import PrimaryButton from '@commercetools-uikit/primary-button';
import SecondaryButton from '@commercetools-uikit/secondary-button';
import Spacings from '@commercetools-uikit/spacings';
Expand All @@ -25,7 +26,7 @@ type Props = {
dataAttributesPrimaryButton?: { [key: string]: string };
dataAttributesSecondaryButton?: { [key: string]: string };
children?: never;
iconLeftSecondaryButton?: ReactElement;
iconLeftSecondaryButton?: ReactElement<TIconProps>;
footerContent?: ReactNode;
};

Expand Down Expand Up @@ -55,7 +56,6 @@ const DialogFooter = ({
<SecondaryButton
label={getFormattedLabel(props.labelSecondary, intl)}
onClick={props.onCancel}
// @ts-ignore FIXME upstream
iconLeft={props.iconLeftSecondaryButton}
{...filterDataAttributes(dataAttributesSecondaryButton)}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ReactElement, SyntheticEvent } from 'react';
import { useIntl } from 'react-intl';
import { sharedMessages } from '@commercetools-frontend/i18n';
import type { TIconProps } from '@commercetools-uikit/design-system';
import IconButton from '@commercetools-uikit/icon-button';
import { BinLinearIcon } from '@commercetools-uikit/icons';
import PrimaryButton from '@commercetools-uikit/primary-button';
Expand Down Expand Up @@ -31,7 +32,7 @@ const useFormattedLabel = (label: Label) => {
};

type PrimaryButtonProps = {
iconLeft?: ReactElement;
iconLeft?: ReactElement<TIconProps>;
} & Props;

const FormPrimaryButton = ({
Expand All @@ -47,7 +48,6 @@ const FormPrimaryButton = ({
label={_label}
onClick={props.onClick}
isDisabled={isDisabled}
// @ts-ignore FIXME upstream
iconLeft={props.iconLeft}
{...filterDataAttributes(dataAttributes)}
/>
Expand All @@ -57,7 +57,7 @@ const FormPrimaryButton = ({
FormPrimaryButton.displayName = 'FormPrimaryButton';

type SecondaryButtonProps = {
iconLeft?: ReactElement;
iconLeft?: ReactElement<TIconProps>;
} & Props;

const FormSecondaryButton = ({
Expand All @@ -73,7 +73,6 @@ const FormSecondaryButton = ({
label={_label}
onClick={props.onClick}
isDisabled={isDisabled}
// @ts-ignore FIXME upstream
iconLeft={props.iconLeft}
{...filterDataAttributes(dataAttributes)}
/>
Expand Down

0 comments on commit aea946e

Please sign in to comment.