Make RelinkDialog supersede the NetworkDialog
This commit is contained in:
parent
1b5c36a9a8
commit
752cd75c54
5 changed files with 9 additions and 26 deletions
|
@ -393,9 +393,9 @@ export class LeftPane extends React.Component<PropsType> {
|
|||
{showArchived ? this.renderArchivedHeader() : renderMainHeader()}
|
||||
</div>
|
||||
{renderExpiredBuildDialog()}
|
||||
{renderRelinkDialog()}
|
||||
{renderNetworkStatus()}
|
||||
{renderUpdateDialog()}
|
||||
{renderRelinkDialog()}
|
||||
{showArchived && (
|
||||
<div className="module-left-pane__archive-helper-text" key={0}>
|
||||
{i18n('archiveHelperText')}
|
||||
|
|
|
@ -13,7 +13,6 @@ import { action } from '@storybook/addon-actions';
|
|||
const i18n = setupI18n('en', enMessages);
|
||||
|
||||
const defaultProps = {
|
||||
hasNetworkDialog: false,
|
||||
i18n,
|
||||
isRegistrationDone: true,
|
||||
relinkDevice: action('relink-device'),
|
||||
|
@ -21,31 +20,19 @@ const defaultProps = {
|
|||
|
||||
const permutations = [
|
||||
{
|
||||
title: 'Unlinked (online)',
|
||||
title: 'Unlinked',
|
||||
props: {
|
||||
isRegistrationDone: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Unlinked (offline)',
|
||||
props: {
|
||||
hasNetworkDialog: true,
|
||||
isRegistrationDone: false,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
storiesOf('Components/RelinkDialog', module)
|
||||
.add('Knobs Playground', () => {
|
||||
const hasNetworkDialog = boolean('hasNetworkDialog', false);
|
||||
const isRegistrationDone = boolean('isRegistrationDone', false);
|
||||
|
||||
return (
|
||||
<RelinkDialog
|
||||
{...defaultProps}
|
||||
hasNetworkDialog={hasNetworkDialog}
|
||||
isRegistrationDone={isRegistrationDone}
|
||||
/>
|
||||
<RelinkDialog {...defaultProps} isRegistrationDone={isRegistrationDone} />
|
||||
);
|
||||
})
|
||||
.add('Iterations', () => {
|
||||
|
|
|
@ -3,19 +3,17 @@ 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) {
|
||||
if (isRegistrationDone) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue