diff --git a/lib/gui/app/components/progress-button/progress-button.tsx b/lib/gui/app/components/progress-button/progress-button.tsx index 62fcff92..9c31aa26 100644 --- a/lib/gui/app/components/progress-button/progress-button.tsx +++ b/lib/gui/app/components/progress-button/progress-button.tsx @@ -84,7 +84,9 @@ export class ProgressButton extends React.PureComponent { return ( <> -
-
- } - /> -
+ } + /> -
- {hasImage ? ( - <> - - {middleEllipsis(imageName || imageBasename, 20)} - - {!flashing && ( - - Remove - - )} - - {shared.bytesToClosestUnit(imageSize)} - - - ) : ( - <> - , - }} - /> - , - }} - /> - - )} -
-
+ {hasImage ? ( + <> + + {middleEllipsis(imageName || imageBasename, 20)} + + {!flashing && ( + + Remove + + )} + {shared.bytesToClosestUnit(imageSize)} + + ) : ( + <> + , + }} + /> + , + }} + /> + + )} +
{this.state.warning != null && ( - + {targets.length} Targets {!props.flashing && ( diff --git a/lib/gui/app/pages/main/DriveSelector.tsx b/lib/gui/app/pages/main/DriveSelector.tsx index 20c1a6bd..b91ec36c 100644 --- a/lib/gui/app/pages/main/DriveSelector.tsx +++ b/lib/gui/app/pages/main/DriveSelector.tsx @@ -16,8 +16,7 @@ import { scanner } from 'etcher-sdk'; import * as React from 'react'; -import styled from 'styled-components'; - +import { Flex } from 'rendition'; import { TargetSelector } from '../../components/target-selector/target-selector-button'; import { TargetSelectorModal } from '../../components/target-selector/target-selector-modal'; import { @@ -30,27 +29,8 @@ import { import * as settings from '../../models/settings'; import { observe } from '../../models/store'; import * as analytics from '../../modules/analytics'; - import DriveSvg from '../../../assets/drive.svg'; -const StepBorder = styled.div<{ - disabled: boolean; - left?: boolean; - right?: boolean; -}>` - height: 2px; - background-color: ${(props) => - props.disabled - ? props.theme.colors.dark.disabled.foreground - : props.theme.colors.dark.foreground}; - position: absolute; - width: 124px; - top: 19px; - - left: ${(props) => (props.left ? '-67px' : undefined)}; - right: ${(props) => (props.right ? '-67px' : undefined)}; -`; - const getDriveListLabel = () => { return getSelectedDrives() .map((drive: any) => { @@ -100,17 +80,13 @@ export const selectAllTargets = ( }; interface DriveSelectorProps { - webviewShowing: boolean; disabled: boolean; - nextStepDisabled: boolean; hasDrive: boolean; flashing: boolean; } export const DriveSelector = ({ - webviewShowing, disabled, - nextStepDisabled, hasDrive, flashing, }: DriveSelectorProps) => { @@ -129,38 +105,25 @@ export const DriveSelector = ({ }); }, []); - const showStepConnectingLines = !webviewShowing || !flashing; - return ( -
- {showStepConnectingLines && ( - <> - - - - )} + + -
- -
- -
- { - setShowTargetSelectorModal(true); - }} - reselectDrive={() => { - analytics.logEvent('Reselect drive'); - setShowTargetSelectorModal(true); - }} - flashing={flashing} - targets={targets} - image={image} - /> -
+ { + setShowTargetSelectorModal(true); + }} + reselectDrive={() => { + analytics.logEvent('Reselect drive'); + setShowTargetSelectorModal(true); + }} + flashing={flashing} + targets={targets} + image={image} + /> {showTargetSelectorModal && ( )} -
+ ); }; diff --git a/lib/gui/app/pages/main/Flash.tsx b/lib/gui/app/pages/main/Flash.tsx index 4eeac6af..1febda66 100644 --- a/lib/gui/app/pages/main/Flash.tsx +++ b/lib/gui/app/pages/main/Flash.tsx @@ -234,62 +234,59 @@ export class FlashStep extends React.PureComponent< public render() { return ( <> -
-
- -
+ + -
- { - this.tryFlash(); - }} - /> - - {!_.isNil(this.props.speed) && - this.props.percentage !== COMPLETED_PERCENTAGE && ( - - {!_.isNil(this.props.speed) && ( - {this.props.speed.toFixed(SPEED_PRECISION)} MB/s - )} - {!_.isNil(this.props.eta) && ( - ETA: {formatSeconds(this.props.eta)} - )} - - )} - - {Boolean(this.props.failed) && ( -
-
- - - {this.props.failed} - - - {messages.progress.failed(this.props.failed)}{' '} - -
-
+ -
+ callback={() => { + this.tryFlash(); + }} + /> + + {!_.isNil(this.props.speed) && + this.props.percentage !== COMPLETED_PERCENTAGE && ( + + {!_.isNil(this.props.speed) && ( + {this.props.speed.toFixed(SPEED_PRECISION)} MB/s + )} + {!_.isNil(this.props.eta) && ( + ETA: {formatSeconds(this.props.eta)} + )} + + )} + + {Boolean(this.props.failed) && ( +
+
+ + + {this.props.failed} + + + {messages.progress.failed(this.props.failed)}{' '} + +
+
+ )} +
{this.state.warningMessages.length > 0 && ( ` + position: relative; + height: 2px; + background-color: ${(props) => + props.disabled + ? props.theme.colors.dark.disabled.foreground + : props.theme.colors.dark.foreground}; + width: 120px; + top: 19px; + + left: ${(props) => (props.left ? '-67px' : undefined)}; + margin-right: ${(props) => (props.left ? '-120px' : undefined)}; + right: ${(props) => (props.right ? '-67px' : undefined)}; + margin-left: ${(props) => (props.right ? '-120px' : undefined)}; +`; + interface MainPageStateFromStore { isFlashing: boolean; hasImage: boolean; @@ -193,73 +213,65 @@ export class MainPage extends React.Component< /> )} - -
- - this.setState({ source }) - } - /> -
+ + this.setState({ source })} + /> -
- -
+ {(!this.state.isWebviewShowing || !this.state.isFlashing) && ( + + + + )} - {this.state.isFlashing && ( -
+ + + {(!this.state.isWebviewShowing || !this.state.isFlashing) && ( + + + + )} + + {this.state.isFlashing && this.state.isWebviewShowing && ( + <> { this.setState({ isWebviewShowing }); }} /> -
+ + )} -
- -
- -
- this.setState({ current: 'success' })} - shouldFlashStepBeDisabled={shouldFlashStepBeDisabled} - source={this.state.source} - isFlashing={flashState.isFlashing()} - step={state.type} - percentage={state.percentage} - position={state.position} - failed={state.failed} - speed={state.speed} - eta={state.eta} - /> -
+ this.setState({ current: 'success' })} + shouldFlashStepBeDisabled={shouldFlashStepBeDisabled} + source={this.state.source} + isFlashing={flashState.isFlashing()} + step={state.type} + percentage={state.percentage} + position={state.position} + failed={state.failed} + speed={state.speed} + eta={state.eta} + />
); diff --git a/lib/gui/app/styled-components.tsx b/lib/gui/app/styled-components.tsx index f2260398..1ef3fc80 100644 --- a/lib/gui/app/styled-components.tsx +++ b/lib/gui/app/styled-components.tsx @@ -54,7 +54,6 @@ export const StepButton = styled((props: ButtonProps) => ( ))` color: #ffffff; - margin: auto; `; export const ChangeButton = styled(Button)`