From 42a13940394a58def8764f3c972943bc449e7652 Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:25:45 -0500 Subject: [PATCH] Fixes My Story subtitle label in privacy modal --- _locales/en/messages.json | 4 ++-- ts/components/SendStoryModal.tsx | 15 ++------------- ts/components/StoriesSettingsModal.tsx | 19 +++++++++++++++++-- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index c7ddb336f68c..73be719cf570 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -5553,7 +5553,7 @@ }, "icu:StoriesSettings__my-story-subtitle": { "messageformat": "All Signal connections", - "description": "Story settings modal my story distribution list selection subtitle" + "description": "(deleted 2022/11/09) Story settings modal my story distribution list selection subtitle" }, "icu:StoriesSettings__custom-story-subtitle": { "messageformat": "Custom story", @@ -5668,7 +5668,7 @@ "description": "Learn more link to learn about who can view your story" }, "StoriesSettings__context-menu": { - "message": "Story settings", + "message": "Story privacy", "description": "Button label to get to story settings" }, "StoriesSettings__view-receipts--label": { diff --git a/ts/components/SendStoryModal.tsx b/ts/components/SendStoryModal.tsx index 2e22f1b6c035..0296c8f57932 100644 --- a/ts/components/SendStoryModal.tsx +++ b/ts/components/SendStoryModal.tsx @@ -12,6 +12,7 @@ import type { LocalizerType } from '../types/Util'; import type { PreferredBadgeSelectorType } from '../state/selectors/badges'; import type { PropsType as StoriesSettingsModalPropsType } from './StoriesSettingsModal'; import { + getI18nForMyStory, getListViewers, DistributionListSettingsModal, EditDistributionListModal, @@ -107,18 +108,6 @@ function getListMemberUuids( return memberUuids; } -function getKeyForMyStoryType(list: StoryDistributionListWithMembersDataType) { - if (list.members.length === 0) { - return 'StoriesSettings__mine__all--label'; - } - - if (!list.isBlockList) { - return 'SendStoryModal__only-share-with'; - } - - return 'StoriesSettings__mine__all--label'; -} - export const SendStoryModal = ({ draftAttachment, candidateConversations, @@ -721,7 +710,7 @@ export const SendStoryModal = ({ <> {list.id === MY_STORIES_ID - ? i18n(getKeyForMyStoryType(list)) + ? getI18nForMyStory(list, i18n) : i18n('SendStoryModal__custom-story')} diff --git a/ts/components/StoriesSettingsModal.tsx b/ts/components/StoriesSettingsModal.tsx index 0936214dfe06..867f67f13db7 100644 --- a/ts/components/StoriesSettingsModal.tsx +++ b/ts/components/StoriesSettingsModal.tsx @@ -113,6 +113,21 @@ export function getListViewers( return i18n('icu:StoriesSettings__viewers', { count: memberCount }); } +export function getI18nForMyStory( + list: StoryDistributionListWithMembersDataType, + i18n: LocalizerType +): string { + if (list.members.length === 0) { + return i18n('StoriesSettings__mine__all--label'); + } + + if (!list.isBlockList) { + return i18n('SendStoryModal__only-share-with'); + } + + return i18n('StoriesSettings__mine__all--label'); +} + type DistributionListItemProps = { i18n: LocalizerType; distributionList: StoryDistributionListWithMembersDataType; @@ -138,7 +153,7 @@ function DistributionListItem({ type="button" > - {distributionList.id === MY_STORIES_ID ? ( + {isMyStories ? ( {isMyStories - ? i18n('icu:StoriesSettings__my-story-subtitle') + ? getI18nForMyStory(distributionList, i18n) : i18n('icu:StoriesSettings__custom-story-subtitle')}  ·  {getListViewers(distributionList, i18n, signalConnections)}