Merge pull request #3144 from balena-io/fix-theme-warnings

Fix theme warnings
This commit is contained in:
Alexis Svinartchouk 2020-05-06 17:46:40 +02:00 committed by GitHub
commit 240a605977
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,14 +130,12 @@ export class MainPage extends React.Component<
});
}
public render() {
private renderMain() {
const shouldDriveStepBeDisabled = !this.state.hasImage;
const shouldFlashStepBeDisabled =
!this.state.hasImage || !this.state.hasDrive;
if (this.state.current === 'main') {
return (
<ThemedProvider style={{ height: '100%', width: '100%' }}>
<>
<header
id="app-header"
style={{
@ -246,9 +244,7 @@ export class MainPage extends React.Component<
: ''
}
driveTitle={middleEllipsis(this.state.driveTitle, 16)}
shouldShow={
this.state.isFlashing && this.state.isWebviewShowing
}
shouldShow={this.state.isFlashing && this.state.isWebviewShowing}
/>
</div>
@ -260,9 +256,11 @@ export class MainPage extends React.Component<
/>
</div>
</Flex>
</ThemedProvider>
</>
);
} else if (this.state.current === 'success') {
}
private renderSuccess() {
return (
<div className="section-loader isFinish">
<FinishPage goToMain={() => this.setState({ current: 'main' })} />
@ -270,6 +268,15 @@ export class MainPage extends React.Component<
</div>
);
}
public render() {
return (
<ThemedProvider style={{ height: '100%', width: '100%' }}>
{this.state.current === 'main'
? this.renderMain()
: this.renderSuccess()}
</ThemedProvider>
);
}
}