diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 74f242a73..db51d7922 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -6583,6 +6583,10 @@ "messageformat": "Reset", "description": "Text of button at the bottom of the username link modal" }, + "icu:UsernameLinkModalBody__done": { + "messageformat": "Done", + "description": "Text of button at the bottom of the username link modal" + }, "icu:UsernameLinkModalBody__color__radio": { "messageformat": "Username link color, {index, number} of {total, number}", "description": "ARIA label of button for selecting username link color" diff --git a/stylesheets/components/UsernameLinkModalBody.scss b/stylesheets/components/UsernameLinkModalBody.scss index d1b4de080..282d4bd94 100644 --- a/stylesheets/components/UsernameLinkModalBody.scss +++ b/stylesheets/components/UsernameLinkModalBody.scss @@ -247,6 +247,11 @@ } } + &__done { + width: 100%; + margin-block-end: 8px; + } + &__colors { &__grid { display: grid; diff --git a/ts/components/ProfileEditor.tsx b/ts/components/ProfileEditor.tsx index eba00c326..ef1ae5aab 100644 --- a/ts/components/ProfileEditor.tsx +++ b/ts/components/ProfileEditor.tsx @@ -535,6 +535,7 @@ export function ProfileEditor({ resetUsernameLink={resetUsernameLink} saveAttachment={saveAttachment} showToast={showToast} + onBack={() => setEditState(EditState.None)} /> ); } else if (editState === EditState.None) { diff --git a/ts/components/UsernameLinkModalBody.stories.tsx b/ts/components/UsernameLinkModalBody.stories.tsx index 3bb351128..15d9f6fa4 100644 --- a/ts/components/UsernameLinkModalBody.stories.tsx +++ b/ts/components/UsernameLinkModalBody.stories.tsx @@ -55,6 +55,7 @@ export default { showToast: { action: true }, resetUsernameLink: { action: true }, setUsernameLinkColor: { action: true }, + onBack: { action: true }, }, } as Meta; diff --git a/ts/components/UsernameLinkModalBody.tsx b/ts/components/UsernameLinkModalBody.tsx index 6dabd10e8..e518a14c9 100644 --- a/ts/components/UsernameLinkModalBody.tsx +++ b/ts/components/UsernameLinkModalBody.tsx @@ -32,6 +32,7 @@ export type PropsType = Readonly<{ resetUsernameLink: () => void; saveAttachment: SaveAttachmentActionCreatorType; showToast: ShowToastAction; + onBack: () => void; }>; export type ColorMapEntryType = Readonly<{ @@ -492,6 +493,8 @@ export function UsernameLinkModalBody({ resetUsernameLink, saveAttachment, showToast, + + onBack, }: PropsType): JSX.Element { const [pngData, setPngData] = useState(); const [showColors, setShowColors] = useState(false); @@ -663,6 +666,14 @@ export function UsernameLinkModalBody({ > {i18n('icu:UsernameLinkModalBody__reset')} + + );