Streamlined system messages

This commit is contained in:
Josh Perez 2021-08-26 16:51:55 -04:00 committed by GitHub
parent 1973224adb
commit 2b08cbfdfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
57 changed files with 864 additions and 937 deletions

View file

@ -4,6 +4,7 @@
import React from 'react';
import classNames from 'classnames';
import { Button, ButtonSize, ButtonVariant } from '../Button';
import { ContactName } from './ContactName';
import { Intl } from '../Intl';
import { LocalizerType } from '../../types/Util';
@ -49,44 +50,51 @@ export const UnsupportedMessage = ({
const stringId = isMe ? meStringId : otherStringId;
return (
<div className="module-unsupported-message">
<div
className={classNames(
'module-unsupported-message__icon',
canProcessNow ? 'module-unsupported-message__icon--can-process' : null
)}
/>
<div className="module-unsupported-message__text">
<Intl
id={stringId}
components={[
<span
key="external-1"
className="module-unsupported-message__contact"
>
<ContactName
name={contact.name}
profileName={contact.profileName}
phoneNumber={contact.phoneNumber}
title={contact.title}
module="module-unsupported-message__contact"
i18n={i18n}
/>
</span>,
]}
i18n={i18n}
<div className="SystemMessage SystemMessage--multiline">
<div className="SystemMessage__line SystemMessage__text">
<div
className={classNames(
'SystemMessage__icon',
'SystemMessage__icon--unsupported',
{
'SystemMessage__icon--unsupported--can-process': canProcessNow,
}
)}
/>
<span>
<Intl
id={stringId}
components={[
<span
key="external-1"
className="module-unsupported-message__contact"
>
<ContactName
name={contact.name}
profileName={contact.profileName}
phoneNumber={contact.phoneNumber}
title={contact.title}
module="module-unsupported-message__contact"
i18n={i18n}
/>
</span>,
]}
i18n={i18n}
/>
</span>
</div>
{canProcessNow ? null : (
<button
type="button"
onClick={() => {
downloadNewVersion();
}}
className="module-unsupported-message__button"
>
{i18n('Message--update-signal')}
</button>
<div className="SystemMessage__line">
<Button
onClick={() => {
downloadNewVersion();
}}
size={ButtonSize.Small}
variant={ButtonVariant.SystemMessage}
>
{i18n('Message--update-signal')}
</Button>
</div>
)}
</div>
);