From f645388b37043a4716f8968cf5a1a1f719a8320d Mon Sep 17 00:00:00 2001 From: "Valentin D. Pinkman" Date: Tue, 3 Jul 2018 18:21:37 +0200 Subject: [PATCH] polish update modals --- src/components/modals/UpdateFirmware/index.js | 1 + .../steps/01-step-install-full-firmware.js | 24 ++++++++++++------- .../UpdateFirmware/steps/02-step-flash-mcu.js | 2 +- .../steps/03-step-confirmation.js | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/components/modals/UpdateFirmware/index.js b/src/components/modals/UpdateFirmware/index.js index 4d10ad60..7eb99708 100644 --- a/src/components/modals/UpdateFirmware/index.js +++ b/src/components/modals/UpdateFirmware/index.js @@ -116,6 +116,7 @@ class UpdateModal extends PureComponent { preventBackdropClick={stepId !== 'finish'} render={() => ( { } componentDidMount() { - this.install() + // this.install() } componentWillUnmount() { @@ -123,6 +117,18 @@ class StepFullFirmwareInstall extends PureComponent { } } + formatHashName = (hash: string): string[] => { + if (!hash) { + return [] + } + + const length = hash.length + const half = Math.ceil(length / 2) + const start = hash.slice(0, half) + const end = hash.slice(half) + return [start, end] + } + renderBody = () => { const { installing } = this.state const { t, firmware } = this.props @@ -141,7 +147,7 @@ class StepFullFirmwareInstall extends PureComponent { {t('app:manager.modal.identifier')}
- {firmware && firmware.hash} + {firmware && firmware.hash && this.formatHashName(firmware.hash).join('\n')}
diff --git a/src/components/modals/UpdateFirmware/steps/02-step-flash-mcu.js b/src/components/modals/UpdateFirmware/steps/02-step-flash-mcu.js index 28e05685..5ab16a86 100644 --- a/src/components/modals/UpdateFirmware/steps/02-step-flash-mcu.js +++ b/src/components/modals/UpdateFirmware/steps/02-step-flash-mcu.js @@ -60,7 +60,7 @@ class StepFlashMcu extends PureComponent { } componentDidMount() { - this.install() + // this.install() } componentWillUnmount() { diff --git a/src/components/modals/UpdateFirmware/steps/03-step-confirmation.js b/src/components/modals/UpdateFirmware/steps/03-step-confirmation.js index 553c0c5a..64318f96 100644 --- a/src/components/modals/UpdateFirmware/steps/03-step-confirmation.js +++ b/src/components/modals/UpdateFirmware/steps/03-step-confirmation.js @@ -31,7 +31,7 @@ function StepConfirmation({ t }: StepProps) { {t('app:manager.modal.successTitle')} - + {t('app:manager.modal.successText')}