Skip to content

Commit 3b35d05

Browse files
committed
Merge branch 'frontend-sdcardwarning-with-link'
2 parents ce5f7c0 + eaa4f45 commit 3b35d05

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

frontends/web/src/components/banners/sdcard.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { Link } from 'react-router-dom';
1718
import { useTranslation } from 'react-i18next';
1819
import type { AccountCode } from '@/api/account';
1920
import type { TDevices } from '@/api/devices';
21+
import type { KeysOf } from '@/utils/types';
2022
import { useSDCard } from '@/hooks/sdcard';
2123
import { Message } from '@/components/message/message';
2224

@@ -32,9 +34,19 @@ export const SDCardWarning = ({
3234
const { t } = useTranslation();
3335
const hasCard = useSDCard(devices, code ? [code] : undefined);
3436

37+
const deviceList: KeysOf<TDevices> = Object.keys(devices);
38+
const firstDevice = deviceList[0];
39+
if (!firstDevice) {
40+
return null;
41+
}
42+
3543
return (
3644
<Message hidden={!hasCard} type="warning">
3745
{t('warning.sdcard')}
46+
<br />
47+
<Link to={`/manage-backups/${firstDevice}`}>
48+
{t('backup.link')}
49+
</Link>
3850
</Message>
3951
);
4052
};

frontends/web/src/locales/en/app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
"description": "Select <strong>wallet backup file</strong>",
136136
"insert": "Please insert the microSD card to manage backups.",
137137
"insertButton": "I have inserted the microSD card",
138+
"link": "Go to manage backups",
138139
"list": "Your microSD card backups",
139140
"noBackups": "There are no backups on this microSD card.",
140141
"restore": {

0 commit comments

Comments
 (0)