Fixes My Story subtitle label in privacy modal
This commit is contained in:
parent
9de31d1b1c
commit
42a1394039
3 changed files with 21 additions and 17 deletions
|
@ -5553,7 +5553,7 @@
|
||||||
},
|
},
|
||||||
"icu:StoriesSettings__my-story-subtitle": {
|
"icu:StoriesSettings__my-story-subtitle": {
|
||||||
"messageformat": "All Signal connections",
|
"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": {
|
"icu:StoriesSettings__custom-story-subtitle": {
|
||||||
"messageformat": "Custom story",
|
"messageformat": "Custom story",
|
||||||
|
@ -5668,7 +5668,7 @@
|
||||||
"description": "Learn more link to learn about who can view your story"
|
"description": "Learn more link to learn about who can view your story"
|
||||||
},
|
},
|
||||||
"StoriesSettings__context-menu": {
|
"StoriesSettings__context-menu": {
|
||||||
"message": "Story settings",
|
"message": "Story privacy",
|
||||||
"description": "Button label to get to story settings"
|
"description": "Button label to get to story settings"
|
||||||
},
|
},
|
||||||
"StoriesSettings__view-receipts--label": {
|
"StoriesSettings__view-receipts--label": {
|
||||||
|
|
|
@ -12,6 +12,7 @@ import type { LocalizerType } from '../types/Util';
|
||||||
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
||||||
import type { PropsType as StoriesSettingsModalPropsType } from './StoriesSettingsModal';
|
import type { PropsType as StoriesSettingsModalPropsType } from './StoriesSettingsModal';
|
||||||
import {
|
import {
|
||||||
|
getI18nForMyStory,
|
||||||
getListViewers,
|
getListViewers,
|
||||||
DistributionListSettingsModal,
|
DistributionListSettingsModal,
|
||||||
EditDistributionListModal,
|
EditDistributionListModal,
|
||||||
|
@ -107,18 +108,6 @@ function getListMemberUuids(
|
||||||
return memberUuids;
|
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 = ({
|
export const SendStoryModal = ({
|
||||||
draftAttachment,
|
draftAttachment,
|
||||||
candidateConversations,
|
candidateConversations,
|
||||||
|
@ -721,7 +710,7 @@ export const SendStoryModal = ({
|
||||||
<>
|
<>
|
||||||
<span className="SendStoryModal__rtl-span">
|
<span className="SendStoryModal__rtl-span">
|
||||||
{list.id === MY_STORIES_ID
|
{list.id === MY_STORIES_ID
|
||||||
? i18n(getKeyForMyStoryType(list))
|
? getI18nForMyStory(list, i18n)
|
||||||
: i18n('SendStoryModal__custom-story')}
|
: i18n('SendStoryModal__custom-story')}
|
||||||
</span>
|
</span>
|
||||||
<span className="SendStoryModal__rtl-span">
|
<span className="SendStoryModal__rtl-span">
|
||||||
|
|
|
@ -113,6 +113,21 @@ export function getListViewers(
|
||||||
return i18n('icu:StoriesSettings__viewers', { count: memberCount });
|
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 = {
|
type DistributionListItemProps = {
|
||||||
i18n: LocalizerType;
|
i18n: LocalizerType;
|
||||||
distributionList: StoryDistributionListWithMembersDataType;
|
distributionList: StoryDistributionListWithMembersDataType;
|
||||||
|
@ -138,7 +153,7 @@ function DistributionListItem({
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<span className="StoriesSettingsModal__list__left">
|
<span className="StoriesSettingsModal__list__left">
|
||||||
{distributionList.id === MY_STORIES_ID ? (
|
{isMyStories ? (
|
||||||
<Avatar
|
<Avatar
|
||||||
acceptedMessageRequest={me.acceptedMessageRequest}
|
acceptedMessageRequest={me.acceptedMessageRequest}
|
||||||
avatarPath={me.avatarPath}
|
avatarPath={me.avatarPath}
|
||||||
|
@ -162,7 +177,7 @@ function DistributionListItem({
|
||||||
/>
|
/>
|
||||||
<span className="StoriesSettingsModal__list__viewers">
|
<span className="StoriesSettingsModal__list__viewers">
|
||||||
{isMyStories
|
{isMyStories
|
||||||
? i18n('icu:StoriesSettings__my-story-subtitle')
|
? getI18nForMyStory(distributionList, i18n)
|
||||||
: i18n('icu:StoriesSettings__custom-story-subtitle')}
|
: i18n('icu:StoriesSettings__custom-story-subtitle')}
|
||||||
·
|
·
|
||||||
{getListViewers(distributionList, i18n, signalConnections)}
|
{getListViewers(distributionList, i18n, signalConnections)}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue