Introduce outage network status
Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
parent
1ca4ee555f
commit
1823f7eca9
11 changed files with 164 additions and 3 deletions
|
@ -13,7 +13,10 @@ import { clearTimeoutIfNecessary } from '../util/clearTimeoutIfNecessary';
|
|||
|
||||
const FIVE_SECONDS = 5 * 1000;
|
||||
|
||||
export type PropsType = Pick<NetworkStateType, 'isOnline' | 'socketStatus'> & {
|
||||
export type PropsType = Pick<
|
||||
NetworkStateType,
|
||||
'isOnline' | 'isOutage' | 'socketStatus'
|
||||
> & {
|
||||
containerWidthBreakpoint: WidthBreakpoint;
|
||||
i18n: LocalizerType;
|
||||
manualReconnect: () => void;
|
||||
|
@ -23,6 +26,7 @@ export function DialogNetworkStatus({
|
|||
containerWidthBreakpoint,
|
||||
i18n,
|
||||
isOnline,
|
||||
isOutage,
|
||||
socketStatus,
|
||||
manualReconnect,
|
||||
}: PropsType): JSX.Element | null {
|
||||
|
@ -48,6 +52,17 @@ export function DialogNetworkStatus({
|
|||
manualReconnect();
|
||||
};
|
||||
|
||||
if (isOutage) {
|
||||
return (
|
||||
<LeftPaneDialog
|
||||
containerWidthBreakpoint={containerWidthBreakpoint}
|
||||
type="warning"
|
||||
icon="error"
|
||||
subtitle={i18n('icu:DialogNetworkStatus__outage')}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (isConnecting) {
|
||||
const spinner = (
|
||||
<div className="LeftPaneDialog__spinner-container">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue