-
-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(suite): add labeling export to zip in debug settings
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/suite/src/views/settings/SettingsDebug/Metadata.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { useState } from 'react'; | ||
|
||
import { Button } from '@trezor/components'; | ||
|
||
import { ActionColumn, SectionItem, TextColumn } from 'src/components/suite'; | ||
import { useDispatch } from 'src/hooks/suite'; | ||
import { exportMetadataToLocalFile } from 'src/actions/suite/metadataActions'; | ||
|
||
export const Metadata = () => { | ||
const dispatch = useDispatch(); | ||
const [exporting, setExporting] = useState(false); | ||
|
||
const onClick = () => { | ||
setExporting(true); | ||
dispatch(exportMetadataToLocalFile()).finally(() => { | ||
setExporting(false); | ||
}); | ||
}; | ||
|
||
return ( | ||
<SectionItem data-testid="@settings/debug/metadata"> | ||
<TextColumn | ||
title="Export" | ||
description="Export labeling files to your computer. You may use this to transfer your labeling files from your Google drive account to your Dropbox account." | ||
/> | ||
<ActionColumn> | ||
<Button onClick={onClick} isDisabled={exporting} isLoading={exporting}> | ||
Export | ||
</Button> | ||
</ActionColumn> | ||
</SectionItem> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters