Skip to content

Commit

Permalink
improve naming of defined TS type interface
Browse files Browse the repository at this point in the history
  • Loading branch information
timur27 committed Jun 7, 2024
1 parent 9b5a5f3 commit 94e2b29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions client/components/duplicate-notice/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { __ } from '@wordpress/i18n';
import { getAdminUrl } from 'wcpay/utils';
import { useDispatch } from '@wordpress/data';

export type DismissedNotices = { [ key: string ]: string[] };
export type PaymentMethodToPluginsMap = { [ key: string ]: string[] };
interface DuplicateNoticeProps {
paymentMethod: string;
gatewaysEnablingPaymentMethod: string[];
dismissedNotices: DismissedNotices;
setDismissedDuplicateNotices: ( notices: DismissedNotices ) => null;
dismissedNotices: PaymentMethodToPluginsMap;
setDismissedDuplicateNotices: (
notices: PaymentMethodToPluginsMap
) => null;
}

function DuplicateNotice( {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* External dependencies
*/
import { createContext } from 'react';
import { DismissedNotices } from '../../components/duplicate-notice';
import { PaymentMethodToPluginsMap } from '../../components/duplicate-notice';

const DuplicatedPaymentMethodsContext = createContext( {
duplicates: {} as DismissedNotices,
dismissedDuplicateNotices: {} as DismissedNotices,
duplicates: {} as PaymentMethodToPluginsMap,
dismissedDuplicateNotices: {} as PaymentMethodToPluginsMap,
setDismissedDuplicateNotices: () => null,
} );

Expand Down

0 comments on commit 94e2b29

Please sign in to comment.