signal-desktop/ts/components/DialogRelink.tsx

40 lines
879 B
TypeScript
Raw Normal View History

// Copyright 2020-2021 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import { LocalizerType } from '../types/Util';
import type { WidthBreakpoint } from './_util';
2021-09-17 22:20:49 +00:00
import { LeftPaneDialog } from './LeftPaneDialog';
export type PropsType = {
containerWidthBreakpoint: WidthBreakpoint;
i18n: LocalizerType;
isRegistrationDone: boolean;
relinkDevice: () => void;
};
2021-08-24 20:59:44 +00:00
export const DialogRelink = ({
containerWidthBreakpoint,
i18n,
isRegistrationDone,
relinkDevice,
}: PropsType): JSX.Element | null => {
if (isRegistrationDone) {
return null;
}
return (
2021-09-17 22:20:49 +00:00
<LeftPaneDialog
containerWidthBreakpoint={containerWidthBreakpoint}
2021-09-17 22:20:49 +00:00
type="warning"
icon="relink"
clickLabel={i18n('unlinkedWarning')}
onClick={relinkDevice}
title={i18n('unlinked')}
hasAction
/>
);
};