Skip to content

Commit

Permalink
PR candidate for the new view state
Browse files Browse the repository at this point in the history
  • Loading branch information
banzzai committed Aug 4, 2023
1 parent cbe7df9 commit 42b2374
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/AcceptAllRejectAllToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let savingTimeout: ReturnType<typeof setTimeout>;
* Component showing explanatory text before offering a way
* to opt out of the sale or share of data
*/
export function DoNotSellExplainer({
export function AcceptAllRejectAllToggle({
handleSetViewState,
fontColor,
}: {
Expand Down
1 change: 1 addition & 0 deletions src/components/BottomMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function BottomMenu({
'CompleteOptionsInverted',
'DoNotSellExplainer',
'LanguageOptions',
'AcceptAllRejectAllToggle',
// eslint-disable-next-line @typescript-eslint/no-explicit-any
].includes(viewState as any) &&
(viewState === 'CompleteOptions' ? (
Expand Down
8 changes: 8 additions & 0 deletions src/components/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { QuickOptions3 } from './QuickOptions3';
import { PrivacyPolicyNotice } from './PrivacyPolicyNotice';
import { AcceptAllOrMoreChoices } from './AcceptAllOrMoreChoices';
import { AcceptOrRejectAllOrMoreChoices } from './AcceptOrRejectAllOrMoreChoices';
import { AcceptAllRejectAllToggle } from './AcceptAllRejectAllToggle';

/**
* Presents view states (collapsed, GDPR-mode, CCPA-mode etc)
Expand Down Expand Up @@ -106,6 +107,13 @@ export function Main({
<AcceptOrRejectAll handleSetViewState={handleSetViewState} />
)}

{viewState === 'AcceptAllRejectAllToggle' && (

Check failure on line 110 in src/components/Main.tsx

View workflow job for this annotation

GitHub Actions / build-and-upload-artifacts

This comparison appears to be unintentional because the types '"LanguageOptions" | "QuickOptions" | "QuickOptions3" | "AcceptAll" | "AcceptAllOrMoreChoices" | "AcceptOrRejectAll" | "AcceptOrRejectAllOrMoreChoices" | "AcceptOrRejectAnalytics" | ... 7 more ... | ResponseViewState' and '"AcceptAllRejectAllToggle"' have no overlap.
<AcceptAllRejectAllToggle
handleSetViewState={handleSetViewState}
fontColor={config.theme.fontColor}
/>
)}

{viewState === 'AcceptAllOrMoreChoices' && (
<AcceptAllOrMoreChoices handleSetViewState={handleSetViewState} />
)}
Expand Down
5 changes: 3 additions & 2 deletions src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ export const messages = defineMessages('ui.src.messages', {
'The title displayed in the AcceptAllRejectAllToggle view state.',
},
acceptAllRejectAllToggleDescription: {
defaultMessage: 'Your Privacy Choices',
description:
defaultMessage:
/* eslint-disable max-len */
'By opting in below, you agree to the storing of cookies on your device for functional, analytics, and advertising purposes.',
/* eslint-enable max-len */
description:
'The description text for the AcceptAllRejectAllToggle view state.',
},
});

Expand Down

0 comments on commit 42b2374

Please sign in to comment.