-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add button to open pop up for managing activities export (#2200)
* add export activities popup * improve popup types * implement activity action menu * update popup * add exportCsv feature flag * fix: code review --------- Co-authored-by: Jean Ribeiro <[email protected]>
- Loading branch information
1 parent
bb0d607
commit 678d271
Showing
10 changed files
with
80 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script lang="ts"> | ||
import { IconName, Menu } from '@bloomwalletio/ui' | ||
import { localize } from '@core/i18n' | ||
import { PopupId, openPopup } from '@desktop/auxiliary/popup' | ||
import features from '@features/features' | ||
let menu: Menu | undefined = undefined | ||
function onExportActivitiesClick(): void { | ||
openPopup({ | ||
id: PopupId.ExportActivities, | ||
}) | ||
menu?.close() | ||
} | ||
const items = [ | ||
...(features.wallet.activityHistory.exportCsv.enabled | ||
? [ | ||
{ | ||
icon: IconName.Download, | ||
title: localize('actions.export'), | ||
onClick: onExportActivitiesClick, | ||
}, | ||
] | ||
: []), | ||
] | ||
</script> | ||
|
||
{#if items.length} | ||
<activity-list-menu> | ||
<Menu bind:this={menu} {items} /> | ||
</activity-list-menu> | ||
{/if} |
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
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
31 changes: 31 additions & 0 deletions
31
packages/desktop/components/popup/popups/ExportActivitiesPopup.svelte
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,31 @@ | ||
<script lang="ts"> | ||
import { localize } from '@core/i18n' | ||
import { closePopup } from '@desktop/auxiliary/popup' | ||
import PopupTemplate from '../PopupTemplate.svelte' | ||
const busy = false | ||
function onCancelClick(): void { | ||
closePopup() | ||
} | ||
function onExportClick(): void { | ||
// TODO: implement CSV export | ||
} | ||
</script> | ||
|
||
<PopupTemplate | ||
title={localize('popups.exportActivities.title')} | ||
description={localize('popups.exportActivities.body')} | ||
backButton={{ | ||
text: localize('actions.cancel'), | ||
onClick: onCancelClick, | ||
disabled: busy, | ||
}} | ||
continueButton={{ | ||
text: localize('actions.export'), | ||
onClick: onExportClick, | ||
disabled: busy, | ||
}} | ||
{busy} | ||
></PopupTemplate> |
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
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
3 changes: 2 additions & 1 deletion
3
packages/desktop/lib/auxiliary/popup/types/popup-component-map.type.ts
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { SvelteComponent } from 'svelte' | ||
import { PopupId } from '../enums' | ||
|
||
export type PopupComponentMap = { [key in PopupId]: unknown } | ||
export type PopupComponentMap = { [key in PopupId]: typeof SvelteComponent } |
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
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
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