Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce TitleTransition notification
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
- Loading branch information
1 parent
4b39639
commit edd2816
Showing
16 changed files
with
329 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
ts/components/conversation/TitleTransitionNotification.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2024 Signal Messenger, LLC | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import * as React from 'react'; | ||
import type { Meta } from '@storybook/react'; | ||
import { setupI18n } from '../../util/setupI18n'; | ||
import enMessages from '../../../_locales/en/messages.json'; | ||
import type { Props } from './TitleTransitionNotification'; | ||
import { TitleTransitionNotification } from './TitleTransitionNotification'; | ||
|
||
export default { | ||
title: 'Components/Conversation/TitleTransitionNotification', | ||
} satisfies Meta<Props>; | ||
|
||
const i18n = setupI18n('en', enMessages); | ||
|
||
export function Default(): JSX.Element { | ||
return <TitleTransitionNotification oldTitle="alice.01" i18n={i18n} />; | ||
} |
39 changes: 39 additions & 0 deletions
39
ts/components/conversation/TitleTransitionNotification.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2024 Signal Messenger, LLC | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
|
||
import React from 'react'; | ||
|
||
import type { LocalizerType } from '../../types/Util'; | ||
import { Intl } from '../Intl'; | ||
|
||
import { SystemMessage } from './SystemMessage'; | ||
import { UserText } from '../UserText'; | ||
|
||
export type PropsData = { | ||
oldTitle: string; | ||
}; | ||
|
||
export type PropsHousekeeping = { | ||
i18n: LocalizerType; | ||
}; | ||
|
||
export type Props = PropsData & PropsHousekeeping; | ||
|
||
export function TitleTransitionNotification(props: Props): JSX.Element { | ||
const { i18n, oldTitle } = props; | ||
|
||
return ( | ||
<SystemMessage | ||
contents={ | ||
<Intl | ||
id="icu:TitleTransition--notification" | ||
components={{ | ||
oldTitle: <UserText text={oldTitle} />, | ||
}} | ||
i18n={i18n} | ||
/> | ||
} | ||
icon="thread" | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.