Make backup import UI part of install
This commit is contained in:
parent
6bd9502f5c
commit
ee0090bb84
26 changed files with 829 additions and 596 deletions
|
@ -5,26 +5,17 @@ import type { ComponentProps, ReactElement } from 'react';
|
|||
import React from 'react';
|
||||
|
||||
import { missingCaseError } from '../util/missingCaseError';
|
||||
import { InstallScreenStep } from '../types/InstallScreen';
|
||||
import { InstallScreenErrorStep } from './installScreen/InstallScreenErrorStep';
|
||||
import { InstallScreenChoosingDeviceNameStep } from './installScreen/InstallScreenChoosingDeviceNameStep';
|
||||
import { InstallScreenLinkInProgressStep } from './installScreen/InstallScreenLinkInProgressStep';
|
||||
import { InstallScreenQrCodeNotScannedStep } from './installScreen/InstallScreenQrCodeNotScannedStep';
|
||||
|
||||
export enum InstallScreenStep {
|
||||
Error,
|
||||
QrCodeNotScanned,
|
||||
ChoosingDeviceName,
|
||||
LinkInProgress,
|
||||
}
|
||||
import { InstallScreenBackupImportStep } from './installScreen/InstallScreenBackupImportStep';
|
||||
|
||||
// We can't always use destructuring assignment because of the complexity of this props
|
||||
// type.
|
||||
|
||||
type PropsType =
|
||||
| {
|
||||
step: InstallScreenStep.Error;
|
||||
screenSpecificProps: ComponentProps<typeof InstallScreenErrorStep>;
|
||||
}
|
||||
| {
|
||||
step: InstallScreenStep.QrCodeNotScanned;
|
||||
screenSpecificProps: ComponentProps<
|
||||
|
@ -42,6 +33,14 @@ type PropsType =
|
|||
screenSpecificProps: ComponentProps<
|
||||
typeof InstallScreenLinkInProgressStep
|
||||
>;
|
||||
}
|
||||
| {
|
||||
step: InstallScreenStep.BackupImport;
|
||||
screenSpecificProps: ComponentProps<typeof InstallScreenBackupImportStep>;
|
||||
}
|
||||
| {
|
||||
step: InstallScreenStep.Error;
|
||||
screenSpecificProps: ComponentProps<typeof InstallScreenErrorStep>;
|
||||
};
|
||||
|
||||
export function InstallScreen(props: Readonly<PropsType>): ReactElement {
|
||||
|
@ -58,6 +57,8 @@ export function InstallScreen(props: Readonly<PropsType>): ReactElement {
|
|||
);
|
||||
case InstallScreenStep.LinkInProgress:
|
||||
return <InstallScreenLinkInProgressStep {...props.screenSpecificProps} />;
|
||||
case InstallScreenStep.BackupImport:
|
||||
return <InstallScreenBackupImportStep {...props.screenSpecificProps} />;
|
||||
default:
|
||||
throw missingCaseError(props);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue