Skip to content

Commit

Permalink
Labels over titles (#197)
Browse files Browse the repository at this point in the history
* labels over titles
  • Loading branch information
kate-kazantseva authored Oct 29, 2024
1 parent 0ac04e3 commit 437f431
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/transcend-io/consent-manager-ui.git"
},
"homepage": "https://github.com/transcend-io/consent-manager-ui",
"version": "4.22.1",
"version": "4.22.2",
"license": "MIT",
"main": "build/ui",
"files": [
Expand Down Expand Up @@ -42,6 +42,7 @@
"playground": "yarn build:playground && concurrently 'WATCH=true yarn build' 'yarn live-server --host=localhost --open=./src/playground/index.html --mount=/src/playground/:./src/'",
"prepublish": "yarn build",
"test": "yarn jest",
"test:update": "yarn jest -u",
"test:watch": "yarn jest --watch"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/useGetPurposeMessageKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export const useGetPurposeMessageKeys = ({
// the purpose type is unique for the bundle
[...Object.keys(consentSelection ?? {}), 'Essential'].reduce(
(allMessages, purposeType) => {
if (allMessages[purposeType]) {
return allMessages;
}
const purposeMessageLabel = `${PURPOSE_MESSAGE_PREFIX}.${purposeType}.title`;
return {
...allMessages,
Expand Down
6 changes: 3 additions & 3 deletions src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,11 @@ export const completeOptionsMessages = defineMessages(
'ui.src.completeOptions',
{
essentialLabel: {
defaultMessage: 'Essential',
defaultMessage: 'Essential purposes',
description: 'Text for essential purposes in CompleteOptions view state.',
},
functionalLabel: {
defaultMessage: 'Functional',
defaultMessage: 'Functionality',
description:
'Text for functional purposes in CompleteOptions view state.',
},
Expand All @@ -527,7 +527,7 @@ export const completeOptionsMessages = defineMessages(
'Text for advertising purposes in CompleteOptions view state.',
},
saleOfInfoLabel: {
defaultMessage: 'SaleOfInfo',
defaultMessage: 'Sale of personal information',
description:
'Text for sale of information purposes in CompleteOptions view state.',
},
Expand Down
4 changes: 3 additions & 1 deletion src/tests/__snapshots__/CompleteOptionsToggles.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ exports[`CompleteOptionsToggles matches snapshot 1`] = `
><span class="switch switch-button"></span></span
>Essential purposes</label
>
<p class="paragraph complete-options-toggle-description"></p></span
<p class="paragraph complete-options-toggle-description">
No consent needed.
</p></span
><span
><label class="switch label"
><input
Expand Down

0 comments on commit 437f431

Please sign in to comment.