Simplify MainPage

Change-type: patch
This commit is contained in:
Alexis Svinartchouk 2020-08-26 00:35:41 +02:00
parent c9bfd350ed
commit 2c07538f8f

View File

@ -242,36 +242,28 @@ export class MainPage extends React.Component<
justifyContent="space-between"
>
{notFlashingOrSplitView && (
<>
<SourceSelector
flashing={this.state.isFlashing}
afterSelected={(source: SourceOptions) =>
this.setState({ source })
}
/>
)}
{notFlashingOrSplitView && (
<Flex>
<StepBorder disabled={shouldDriveStepBeDisabled} left />
</Flex>
)}
{notFlashingOrSplitView && (
<DriveSelector
disabled={shouldDriveStepBeDisabled}
hasDrive={this.state.hasDrive}
flashing={this.state.isFlashing}
/>
)}
{notFlashingOrSplitView && (
<Flex>
<StepBorder disabled={shouldFlashStepBeDisabled} right />
</Flex>
</>
)}
{this.state.isFlashing && (
<>
{this.state.isFlashing && this.state.isWebviewShowing && (
<Flex
style={{
position: 'absolute',
@ -281,7 +273,6 @@ export class MainPage extends React.Component<
height: '100vh',
zIndex: 1,
boxShadow: '0 2px 15px 0 rgba(0, 0, 0, 0.2)',
display: this.state.isWebviewShowing ? 'block' : 'none',
}}
>
<ReducedFlashingInfos
@ -302,7 +293,8 @@ export class MainPage extends React.Component<
}}
/>
</Flex>
{this.state.featuredProjectURL && (
)}
{this.state.isFlashing && this.state.featuredProjectURL && (
<SafeWebview
src={this.state.featuredProjectURL}
onWebviewShow={(isWebviewShowing: boolean) => {
@ -317,8 +309,6 @@ export class MainPage extends React.Component<
}}
/>
)}
</>
)}
<FlashStep
goToSuccess={() => this.setState({ current: 'success' })}