signal-desktop/ts/components/DialogRelink.tsx

34 lines
780 B
TypeScript
Raw Normal View History

2023-01-03 19:55:46 +00:00
// Copyright 2020 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
import React from 'react';
import type { 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;
relinkDevice: () => void;
};
2022-11-18 00:45:19 +00:00
export function DialogRelink({
containerWidthBreakpoint,
i18n,
relinkDevice,
2022-11-18 00:45:19 +00:00
}: PropsType): JSX.Element | 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"
2023-03-30 00:03:25 +00:00
clickLabel={i18n('icu:unlinkedWarning')}
2021-09-17 22:20:49 +00:00
onClick={relinkDevice}
2023-03-30 00:03:25 +00:00
title={i18n('icu:unlinked')}
2021-09-17 22:20:49 +00:00
hasAction
/>
);
2022-11-18 00:45:19 +00:00
}