Skip to content

Commit

Permalink
frontend: revamp sdcardcheck (bb02) UI
Browse files Browse the repository at this point in the history
Use view component and new design in the sdcardcheck component
(manage backups) for the bb02, instead of the Dialog.

This is done to improve UX
  • Loading branch information
shonsirsha committed Dec 9, 2024
1 parent e1d6d34 commit 6ef2731
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
1 change: 1 addition & 0 deletions frontends/web/src/locales/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@
},
"stepInsertSD": {
"insertSDCard": "Please insert a microSD card into your BitBox02 to continue.",
"insertSDCardToSeeBackups": "Please insert the microSD card into your BitBox02 to see your backups.",
"insertSDcardTitle": "Insert microSD card"
},
"stepPassword": {
Expand Down
26 changes: 13 additions & 13 deletions frontends/web/src/routes/device/bitbox02/sdcardcheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import { ReactNode, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { checkSDCard } from '@/api/bitbox02';
import { Dialog, DialogButtons } from '@/components/dialog/dialog';
import { Button } from '@/components/forms';
import { PointToBitBox02 } from '@/components/icon';
import { View, ViewButtons, ViewContent, ViewHeader } from '@/components/view/view';
import { BackButton } from '@/components/backbutton/backbutton';
import { HorizontallyCenteredSpinner } from '@/components/spinner/SpinnerAnimation';

Expand All @@ -44,25 +45,24 @@ const SDCardCheck = ({ deviceID, children }: TProps) => {
return (
<div>
{!sdCardInserted ? (
<Dialog open={!sdCardInserted} title="Check your device" small>
<div className="columnsContainer half">
<div className="columns">
<div className="column">
<p>{t('backup.insert')}</p>
</div>
</div>
</div>
<DialogButtons>
<View textCenter>
<ViewHeader title={t('bitbox02Wizard.stepInsertSD.insertSDcardTitle')}>
{t('bitbox02Wizard.stepInsertSD.insertSDCardToSeeBackups')}
</ViewHeader>
<ViewContent minHeight="280px">
<PointToBitBox02 />
</ViewContent>
<ViewButtons>
<Button
primary
onClick={check}>
{t('button.ok')}
</Button>
<BackButton>
<BackButton enableEsc>
{t('button.back')}
</BackButton>
</DialogButtons>
</Dialog>
</ViewButtons>
</View>
) : children}
</div>
);
Expand Down
21 changes: 12 additions & 9 deletions frontends/web/src/routes/device/manage-backups/manage-backups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export const ManageBackups = ({
title={<h2>{t('backup.title')}</h2>}
/>
<div className="content padded">
<h3 className="subTitle">{t('backup.list')}</h3>
<BackupsList
deviceID={deviceID}
devices={devices}
Expand All @@ -74,15 +73,19 @@ const BackupsList = ({
}
switch (devices[deviceID]) {
case 'bitbox':

return (
<Backups
deviceID={deviceID}
showCreate={true}
showRestore={false}>
<BackButton>
{t('button.back')}
</BackButton>
</Backups>
<>
<h3 className="subTitle">{t('backup.list')}</h3>
<Backups
deviceID={deviceID}
showCreate={true}
showRestore={false}>
<BackButton>
{t('button.back')}
</BackButton>
</Backups>
</>
);
case 'bitbox02':
return (
Expand Down

0 comments on commit 6ef2731

Please sign in to comment.