Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random todos #1284

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions client/components/mma/shared/CardDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import { palette } from '@guardian/source-foundations';
import type { Inlineable } from './inlineable';

interface CardExpiryDetails {
month: number;
Expand All @@ -14,7 +13,7 @@ export interface CardProps {
stripePublicKeyForUpdate?: string;
}

interface CardDisplayProps extends CardProps, Inlineable {
interface CardDisplayProps extends CardProps {
cssOverrides?: SerializedStyles;
inErrorState?: boolean;
}
Expand Down
4 changes: 2 additions & 2 deletions client/components/mma/shared/DirectDebitDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { css } from '@emotion/react';
import { from, palette } from '@guardian/source-foundations';
import type { DirectDebitDetails } from '../../../../shared/productResponse';
import { DirectDebitLogo } from './assets/DirectDebitLogo';
import type { Inlineable } from './inlineable';

const NUMBER_OF_ACCOUNT_NUMBER_DIGITS_TO_SHOW = 3;

Expand Down Expand Up @@ -54,11 +53,12 @@ export const sanitiseAccountNumber = (
);
};

interface DirectDebitDisplayProps extends DirectDebitDetails, Inlineable {
interface DirectDebitDisplayProps extends DirectDebitDetails {
showAccountName?: true;
inErrorState?: boolean;
onlyAccountEnding?: true;
onlySortCode?: true;
inline?: true;
}

export const DirectDebitDisplay = (props: DirectDebitDisplayProps) => {
Expand Down
5 changes: 0 additions & 5 deletions client/components/mma/shared/inlineable.ts

This file was deleted.

11 changes: 8 additions & 3 deletions client/components/shared/SectionContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,14 @@ const divCss = (hasNav: boolean | undefined) => css`
}
`;

export const SelectedTopicObjectContext = createContext<
Dispatch<SetStateAction<string | undefined>>
>(undefined!); // eslint-disable-line @typescript-eslint/no-non-null-assertion -- // TODO: refactor this var to remove need for disabling eslint rule
const defaultDispatch = (_value: SetStateAction<string | undefined>) => {
return;
};

export const SelectedTopicObjectContext =
createContext<Dispatch<SetStateAction<string | undefined>>>(
defaultDispatch,
);

export const SectionContent = (props: SectionContentProps) => {
const [selectedTopicId, setSelectedTopicId] = useState<string | undefined>(
Expand Down
2 changes: 1 addition & 1 deletion shared/productTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { SoftOptInIDs } from './softOptInIDs';

type ProductFriendlyName =
| 'Membership'
| 'recurring contribution' // TODO use payment frequency instead of 'recurring' e.g. monthly annual etc
| 'recurring contribution'
| 'newspaper subscription'
| 'newspaper voucher subscription'
| 'newspaper subscription card'
Expand Down
Loading