Skip to content

Commit

Permalink
fix: icon type
Browse files Browse the repository at this point in the history
  • Loading branch information
kark committed Jan 14, 2025
1 parent 35aa95f commit 4d577f0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {
SyntheticEvent,
} from 'react';
import { sharedMessages } from '@commercetools-frontend/i18n';
import type { TIconProps } from '@commercetools-uikit/design-system';
import PageHeaderTitle from '../../internals/page-header-title';
import CustomFormDetailPage from '../custom-form-detail-page';

Expand Down Expand Up @@ -91,7 +92,7 @@ type FormDetailPageProps = {
/**
* The Icon for the secondary button label
*/
iconLeftSecondaryButton?: ReactElement;
iconLeftSecondaryButton?: ReactElement<TIconProps>;
};

const FormDetailPage = ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { SyntheticEvent, ReactNode, ReactElement } from 'react';
import { sharedMessages } from '@commercetools-frontend/i18n';
import type { TIconProps } from '@commercetools-uikit/design-system';
import DialogContainer from '../internals/dialog-container';
import DialogContent from '../internals/dialog-content';
import DialogFooter from '../internals/dialog-footer';
Expand Down Expand Up @@ -30,7 +31,7 @@ export type TFormDialogProps = {
dataAttributesSecondaryButton?: { [key: string]: string };
dataAttributesPrimaryButton?: { [key: string]: string };
getParentSelector?: () => HTMLElement;
iconLeftSecondaryButton?: ReactElement;
iconLeftSecondaryButton?: ReactElement<TIconProps>;
footerContent?: ReactNode;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import type { ReactElement, ReactNode, SyntheticEvent } from 'react';
import styled, { type CSSObject } from '@emotion/styled';
import { useIntl } from 'react-intl';
import { sharedMessages } from '@commercetools-frontend/i18n';
import { designTokens as uiKitDesignTokens } from '@commercetools-uikit/design-system';
import {
designTokens as uiKitDesignTokens,
type TIconProps,
} from '@commercetools-uikit/design-system';
import { CloseIcon } from '@commercetools-uikit/icons';
import SecondaryIconButton from '@commercetools-uikit/secondary-icon-button';
import Spacings from '@commercetools-uikit/spacings';
Expand Down Expand Up @@ -52,7 +55,7 @@ type TDrawerProps = {
labelSecondaryButton?: Label;
onPrimaryButtonClick?: (event: SyntheticEvent) => void;
onSecondaryButtonClick?: (event: SyntheticEvent) => void;
iconLeftSecondaryButton?: ReactElement;
iconLeftSecondaryButton?: ReactElement<TIconProps>;
};

const ContentWrapper = styled.div`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ReactElement, ReactNode, SyntheticEvent } from 'react';
import { sharedMessages } from '@commercetools-frontend/i18n';
import type { TIconProps } from '@commercetools-uikit/design-system';
import PageHeaderTitle from '../../internals/page-header-title';
import CustomFormMainPage from '../custom-form-main-page';

Expand Down Expand Up @@ -61,7 +62,7 @@ type FormMainPageProps = {
/**
* The Icon for the secondary button label
*/
iconLeftSecondaryButton?: ReactElement;
iconLeftSecondaryButton?: ReactElement<TIconProps>;
/**
* This code is used to configure which Custom Views are available for this page.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SyntheticEvent, ReactNode, ReactElement } from 'react';
import type { CSSObject } from '@emotion/react';

import { sharedMessages } from '@commercetools-frontend/i18n';
import type { TIconProps } from '@commercetools-uikit/design-system';
import CustomFormModalPage from '../custom-form-modal-page';

// NOTE: the `MessageDescriptor` type is exposed by `react-intl`.
Expand Down Expand Up @@ -50,7 +50,7 @@ type Props = {
onPrimaryButtonClick: (event: SyntheticEvent) => void;
onSecondaryButtonClick: (event: SyntheticEvent) => void;
hideControls?: boolean;
iconLeftSecondaryButton?: ReactElement;
iconLeftSecondaryButton?: ReactElement<TIconProps>;
};

const FormModalPage = ({ hideControls = false, ...props }: Props) => (
Expand Down
42 changes: 3 additions & 39 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4d577f0

Please sign in to comment.