Skip to content

Commit

Permalink
Story settings modal copy and design changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiebuilds-signal committed Oct 26, 2022
1 parent 7f0a668 commit 5ccfabe
Show file tree
Hide file tree
Showing 9 changed files with 295 additions and 93 deletions.
14 changes: 9 additions & 5 deletions _locales/en/messages.json
Expand Up @@ -5388,7 +5388,7 @@
"description": "Label of the button on the bottom of the media editor that trigger the add-caption dialog"
},
"MyStories__title": {
"message": "My Stories",
"message": "My Story",
"description": "Title for the my stories list"
},
"MyStories__story": {
Expand Down Expand Up @@ -5460,7 +5460,7 @@
"description": "Title for the stories list"
},
"Stories__mine": {
"message": "My Stories",
"message": "My Story",
"description": "Label for your stories"
},
"Stories__add": {
Expand Down Expand Up @@ -5515,6 +5515,10 @@
"message": "Story settings",
"description": "Title for the story settings modal"
},
"icu:StoriesSettings__description": {
"messageformat": "Stories automatically disapper after 24 hours. Choose who can view your story or create new stories with specific viewers or groups.",
"description": "Description for story settings modal"
},
"StoriesSettings__new-list": {
"message": "New custom story",
"description": "Label to create a new custom distribution list"
Expand Down Expand Up @@ -5600,7 +5604,7 @@
"description": "Description of button StoriesSettings__mine__all--label"
},
"StoriesSettings__mine__exclude--label": {
"message": "All Signal connections except...",
"message": "All except...",
"description": "Input label to create a block list"
},
"StoriesSettings__mine__exclude--description": {
Expand Down Expand Up @@ -5704,8 +5708,8 @@
"description": "Modal title when choosing groups"
},
"SendStoryModal__my-stories-privacy": {
"message": "My stories privacy",
"description": "Modal title for setting privacy for My Stories"
"message": "My Story privacy",
"description": "Modal title for setting privacy for My Story"
},
"SendStoryModal__privacy-disclaimer": {
"message": "Choose which Signal connections can view your story. You can always change this in privacy settings. $learnMore$",
Expand Down
2 changes: 1 addition & 1 deletion stylesheets/_mixins.scss
Expand Up @@ -74,7 +74,7 @@

@mixin font-subtitle {
@include font-family;
font-size: 11px;
font-size: 12px;
line-height: 16px;
letter-spacing: 0;
}
Expand Down
75 changes: 70 additions & 5 deletions stylesheets/components/StoriesSettingsModal.scss
Expand Up @@ -74,9 +74,9 @@
@include font-body-1;
align-items: center;
display: flex;
height: 52px;
justify-content: space-between;
width: 100%;
padding: 8px 0;

&--no-pointer {
cursor: inherit;
Expand Down Expand Up @@ -144,9 +144,9 @@
}

&__divider {
border-color: $color-gray-65;
border-style: solid;
width: 100%;
border: 0 solid $color-gray-65;
border-top-width: 1px;
}

&__input__container {
Expand All @@ -165,12 +165,51 @@
margin-top: 32px;
}

&__description {
@include font-subtitle;
color: $color-gray-25;
margin-top: 0px;
margin-bottom: 16px;
}

&__listHeader {
display: flex;
align-items: center;
}

&__listHeader__title {
flex: 1;
@include font-body-1-bold;
margin-right: 8px;
}

&__listHeader__button {
@include button-reset;
@include button-secondary;
@include rounded-corners;
padding: 4px 10px;
@include font-family;
font-size: 12px;
display: flex;
align-items: center;

&::before {
content: '';
display: inline-block;
width: 12px;
height: 12px;
flex-shrink: 0;
margin-right: 6px;
@include color-svg('../images/icons/v2/plus-24.svg', $color-white);
}
}

&__delete-list {
@include button-reset;
align-items: center;
color: $color-accent-red;
display: flex;
height: 52px;
padding: 8px 0;
width: 100%;

&::before {
Expand All @@ -186,7 +225,22 @@
}

&__checkbox {
margin: 18px 0;
margin: 14px 0;
}

&__checkbox-container {
flex: 1;
display: flex;
align-items: center;
}

&__checkbox-label {
flex: 1;
margin-right: 8px;
}

&__checkbox-description {
color: $color-gray-25;
}

&__conversation-list {
Expand All @@ -204,4 +258,15 @@
color: $color-gray-05;
}
}

&__stories-off-container {
display: flex;
gap: 16;
align-items: center;
}

&__stories-off-text {
flex: 1;
font-size: 12px;
}
}
3 changes: 2 additions & 1 deletion ts/components/Checkbox.tsx
Expand Up @@ -12,6 +12,7 @@ export type PropsType = {
id: string;
checkboxNode: JSX.Element;
labelNode: JSX.Element;
checked?: boolean;
}) => JSX.Element;
description?: string;
disabled?: boolean;
Expand Down Expand Up @@ -65,7 +66,7 @@ export const Checkbox = ({
<div className={getClassName('')}>
<div className={getClassName('__container')}>
{children ? (
children({ id, checkboxNode, labelNode })
children({ id, checkboxNode, labelNode, checked })
) : (
<>
{checkboxNode}
Expand Down
2 changes: 1 addition & 1 deletion ts/components/SendStoryModal.tsx
Expand Up @@ -113,7 +113,7 @@ function getKeyForMyStoryType(list: StoryDistributionListWithMembersDataType) {
return 'StoriesSettings__mine__all--label';
}

function getListViewers(
export function getListViewers(
list: StoryDistributionListWithMembersDataType,
i18n: LocalizerType,
signalConnections: Array<ConversationType>
Expand Down
12 changes: 11 additions & 1 deletion ts/components/StoriesSettingsModal.stories.tsx
Expand Up @@ -7,7 +7,10 @@ import React from 'react';
import type { PropsType } from './StoriesSettingsModal';
import enMessages from '../../_locales/en/messages.json';
import { StoriesSettingsModal } from './StoriesSettingsModal';
import { getDefaultConversation } from '../test-both/helpers/getDefaultConversation';
import {
getDefaultConversation,
getDefaultGroup,
} from '../test-both/helpers/getDefaultConversation';
import { setupI18n } from '../util/setupI18n';
import {
getMyStories,
Expand All @@ -23,9 +26,15 @@ export default {
candidateConversations: {
defaultValue: Array.from(Array(100), () => getDefaultConversation()),
},
signalConnections: {
defaultValue: Array.from(Array(42), getDefaultConversation),
},
distributionLists: {
defaultValue: [],
},
groupStories: {
defaultValue: Array.from(Array(2), getDefaultGroup),
},
getPreferredBadge: { action: true },
hideStoriesSettings: { action: true },
i18n: {
Expand All @@ -43,6 +52,7 @@ export default {
onViewersUpdated: { action: true },
setMyStoriesToAllSignalConnections: { action: true },
toggleSignalConnectionsModal: { action: true },
setStoriesDisabled: { action: true },
},
} as Meta;

Expand Down

0 comments on commit 5ccfabe

Please sign in to comment.