Decouple RelinkDialog from NetworkStatusDialog

This commit is contained in:
Josh Perez 2020-04-16 15:20:52 -04:00 committed by GitHub
parent 0970c73310
commit 4dc7631851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 123 additions and 37 deletions

View file

@ -0,0 +1,33 @@
import React from 'react';
import { LocalizerType } from '../types/Util';
export interface PropsType {
hasNetworkDialog: boolean;
i18n: LocalizerType;
isRegistrationDone: boolean;
relinkDevice: () => void;
}
export const RelinkDialog = ({
hasNetworkDialog,
i18n,
isRegistrationDone,
relinkDevice,
}: PropsType): JSX.Element | null => {
if (hasNetworkDialog || isRegistrationDone) {
return null;
}
return (
<div className="module-left-pane-dialog module-left-pane-dialog--warning">
<div className="module-left-pane-dialog__message">
<h3>{i18n('unlinked')}</h3>
<span>{i18n('unlinkedWarning')}</span>
</div>
<div className="module-left-pane-dialog__actions">
<button onClick={relinkDevice}>{i18n('relink')}</button>
</div>
</div>
);
};