Move link notification to the conversation hero

This commit is contained in:
Josh Perez 2022-04-25 17:03:24 -04:00 committed by GitHub
parent 5f3a62cbb6
commit 2f44e33c9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 174 additions and 350 deletions

View file

@ -204,6 +204,9 @@ export const ConversationHero = ({
phoneNumber,
sharedGroupNames,
})}
<div className="module-conversation-hero__linkNotification">
{i18n('messageHistoryUnsynced')}
</div>
</div>
{isShowingMessageRequestWarning && (
<ConfirmationDialog

View file

@ -1,16 +0,0 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { setupI18n } from '../../util/setupI18n';
import enMessages from '../../../_locales/en/messages.json';
import { LinkNotification } from './LinkNotification';
const story = storiesOf('Components/Conversation/LinkNotification', module);
const i18n = setupI18n('en', enMessages);
story.add('Default', () => <LinkNotification i18n={i18n} />);

View file

@ -1,13 +0,0 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as React from 'react';
import { SystemMessage } from './SystemMessage';
import type { LocalizerType } from '../../types/Util';
export const LinkNotification = ({
i18n,
}: Readonly<{ i18n: LocalizerType }>): JSX.Element => (
<SystemMessage icon="unsynced" contents={i18n('messageHistoryUnsynced')} />
);

View file

@ -337,11 +337,6 @@ const items: Record<string, TimelineItemType> = {
},
timestamp: Date.now(),
},
'id-15': {
type: 'linkNotification',
data: null,
timestamp: Date.now(),
},
};
const actions = () => ({

View file

@ -417,10 +417,6 @@ storiesOf('Components/Conversation/TimelineItem', module)
startedTime: Date.now(),
},
},
{
type: 'linkNotification',
data: null,
},
{
type: 'profileChange',
data: {

View file

@ -23,7 +23,6 @@ import type {
PropsDataType as DeliveryIssueProps,
} from './DeliveryIssueNotification';
import { DeliveryIssueNotification } from './DeliveryIssueNotification';
import { LinkNotification } from './LinkNotification';
import type { PropsData as ChangeNumberNotificationProps } from './ChangeNumberNotification';
import { ChangeNumberNotification } from './ChangeNumberNotification';
import type { CallingNotificationType } from '../../util/callingNotification';
@ -69,10 +68,6 @@ type DeliveryIssueType = {
type: 'deliveryIssue';
data: DeliveryIssueProps;
};
type LinkNotificationType = {
type: 'linkNotification';
data: null;
};
type MessageType = {
type: 'message';
data: Omit<MessageProps, 'renderingContext'>;
@ -129,7 +124,6 @@ export type TimelineItemType = (
| GroupNotificationType
| GroupV1MigrationType
| GroupV2ChangeType
| LinkNotificationType
| MessageType
| ProfileChangeNotificationType
| ResetSessionNotificationType
@ -261,8 +255,6 @@ export class TimelineItem extends React.PureComponent<PropsType> {
i18n={i18n}
/>
);
} else if (item.type === 'linkNotification') {
notification = <LinkNotification i18n={i18n} />;
} else if (item.type === 'timerNotification') {
notification = (
<TimerNotification {...this.props} {...item.data} i18n={i18n} />