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
instead of the Dialog - done to improve UX
  • Loading branch information
shonsirsha committed Dec 9, 2024
1 parent e1d6d34 commit df18870
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
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="Insert microSD card">
Please insert the microSD card into your BitBox02 to see your backups.
</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 df18870

Please sign in to comment.