Skip to content

Commit

Permalink
pretty
Browse files Browse the repository at this point in the history
  • Loading branch information
kate-kazantseva committed Oct 25, 2024
1 parent 7cc76fd commit 81736b3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/components/CompleteOptionsToggles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function CompleteOptionsToggles({
/>
<p className="paragraph complete-options-toggle-description">
{formatMessage(
purposeToDescriptionKey['Essential'],
purposeToDescriptionKey.Essential,
globalUiVariables,
)}
</p>
Expand Down
42 changes: 21 additions & 21 deletions src/hooks/useGetPurposeMessageKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const PURPOSE_MESSAGE_PREFIX = 'purpose.trackingType';
export const useGetPurposeMessageKeys = ({
consentSelection,
defaultPurposeToMessageKey,
inverted=false,
inverted = false,
}: {
/** The configured airgap purpose types */
consentSelection: ConsentSelection;
Expand All @@ -21,32 +21,32 @@ export const useGetPurposeMessageKeys = ({
const purposeToMessageKey: Record<string, DefinedMessage> = useMemo(
() =>
// the purpose type is unique for the bundle
[...Object.keys(consentSelection ?? {}), 'Essential'].reduce(
(allMessages, purposeType) => {
if (!inverted) {
const purposeMessageLabel = `${PURPOSE_MESSAGE_PREFIX}.${purposeType}.title`;
[...Object.keys(consentSelection ?? {}), 'Essential'].reduce(
(allMessages, purposeType) => {
if (!inverted) {
const purposeMessageLabel = `${PURPOSE_MESSAGE_PREFIX}.${purposeType}.title`;
return {
...allMessages,
[purposeType]: {
id: purposeMessageLabel,
defaultMessage: purposeType,
description: `Translatable name for purpose '${purposeType}'`,
} as DefinedMessage,
};
}
return {
...allMessages,
[purposeType]: {
id: purposeMessageLabel,
defaultMessage: purposeType,
id: `cm-ui.purpose.${purposeType}`,
defaultMessage:
defaultPurposeToMessageKey[purposeType]?.defaultMessage ||
purposeType,
description: `Translatable name for purpose '${purposeType}'`,
} as DefinedMessage,
};
}
return {
...allMessages,
[purposeType]: {
id: `cm-ui.purpose.${purposeType}`,
defaultMessage:
defaultPurposeToMessageKey[purposeType]?.defaultMessage ||
purposeType,
description: `Translatable name for purpose '${purposeType}'`,
} as DefinedMessage,
};
},
defaultPurposeToMessageKey as Record<string, DefinedMessage>
),
},
defaultPurposeToMessageKey as Record<string, DefinedMessage>
),
[consentSelection, defaultPurposeToMessageKey],
);

Expand Down

0 comments on commit 81736b3

Please sign in to comment.