Browse Source

polish update modals

master
Valentin D. Pinkman 7 years ago
parent
commit
f645388b37
No known key found for this signature in database GPG Key ID: E7D110669FFB8D3E
  1. 1
      src/components/modals/UpdateFirmware/index.js
  2. 24
      src/components/modals/UpdateFirmware/steps/01-step-install-full-firmware.js
  3. 2
      src/components/modals/UpdateFirmware/steps/02-step-flash-mcu.js
  4. 2
      src/components/modals/UpdateFirmware/steps/03-step-confirmation.js

1
src/components/modals/UpdateFirmware/index.js

@ -116,6 +116,7 @@ class UpdateModal extends PureComponent<Props, State> {
preventBackdropClick={stepId !== 'finish'} preventBackdropClick={stepId !== 'finish'}
render={() => ( render={() => (
<Stepper <Stepper
onStepChange={this.handleStepChange}
title={t('app:manager.firmware.update')} title={t('app:manager.firmware.update')}
initialStepId={stepId} initialStepId={stepId}
steps={this.STEPS} steps={this.STEPS}

24
src/components/modals/UpdateFirmware/steps/01-step-install-full-firmware.js

@ -46,13 +46,7 @@ const Address = styled(Box).attrs({
cursor: text; cursor: text;
user-select: text; user-select: text;
width: 325px; width: 325px;
` text-align: center;
const Ellipsis = styled.span`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
` `
type Props = StepProps & { type Props = StepProps & {
@ -69,7 +63,7 @@ class StepFullFirmwareInstall extends PureComponent<Props, State> {
} }
componentDidMount() { componentDidMount() {
this.install() // this.install()
} }
componentWillUnmount() { componentWillUnmount() {
@ -123,6 +117,18 @@ class StepFullFirmwareInstall extends PureComponent<Props, State> {
} }
} }
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 = () => { renderBody = () => {
const { installing } = this.state const { installing } = this.state
const { t, firmware } = this.props const { t, firmware } = this.props
@ -141,7 +147,7 @@ class StepFullFirmwareInstall extends PureComponent<Props, State> {
{t('app:manager.modal.identifier')} {t('app:manager.modal.identifier')}
</Text> </Text>
<Address> <Address>
<Ellipsis>{firmware && firmware.hash}</Ellipsis> {firmware && firmware.hash && this.formatHashName(firmware.hash).join('\n')}
</Address> </Address>
</Box> </Box>
<Box mt={5}> <Box mt={5}>

2
src/components/modals/UpdateFirmware/steps/02-step-flash-mcu.js

@ -60,7 +60,7 @@ class StepFlashMcu extends PureComponent<Props, State> {
} }
componentDidMount() { componentDidMount() {
this.install() // this.install()
} }
componentWillUnmount() { componentWillUnmount() {

2
src/components/modals/UpdateFirmware/steps/03-step-confirmation.js

@ -31,7 +31,7 @@ function StepConfirmation({ t }: StepProps) {
<CheckCircle size={44} /> <CheckCircle size={44} />
</Box> </Box>
<Title>{t('app:manager.modal.successTitle')}</Title> <Title>{t('app:manager.modal.successTitle')}</Title>
<Box mt={2} mb={8}> <Box mt={2} mb={5}>
<Text ff="Open Sans|Regular" fontSize={4} color="graphite"> <Text ff="Open Sans|Regular" fontSize={4} color="graphite">
{t('app:manager.modal.successText')} {t('app:manager.modal.successText')}
</Text> </Text>

Loading…
Cancel
Save