Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add account management router #7991

Merged
merged 5 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/desktop/features/account-management.features.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { IAccountManagementFeatures } from '@lib/features/interfaces'

const accountManagementFeatures: IAccountManagementFeatures = {
enabled: false,
}

export default accountManagementFeatures
2 changes: 2 additions & 0 deletions packages/desktop/features/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import settingsFeatures from './settings.features'
import walletFeatures from './wallet.features'
import analyticsFeatures from './analytics.features'
import vestingFeatures from './vesting.features'
import accountManagementFeatures from './account-management.features'
import { IDesktopFeatures } from './interfaces'

const features: IDesktopFeatures = {
Expand All @@ -21,6 +22,7 @@ const features: IDesktopFeatures = {
wallet: walletFeatures,
analytics: analyticsFeatures,
vesting: vestingFeatures,
accountManagement: accountManagementFeatures,
}

export default features
3 changes: 2 additions & 1 deletion packages/desktop/views/dashboard/Dashboard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import { stopPollingLedgerNanoStatus } from '@core/ledger'
import { removeDisplayNotification, showAppNotification } from '@auxiliary/notification'
import { Platform } from '@core/app'
import { Developer, Settings, Vesting, Collectibles, Governance, Wallet } from './'
import { Developer, Settings, Vesting, Collectibles, Governance, Wallet, AccountManagement } from './'
import { onDestroy, onMount } from 'svelte'
import Sidebar from './Sidebar.svelte'
import TopNavigation from './TopNavigation.svelte'
Expand Down Expand Up @@ -42,6 +42,7 @@
governance: Governance,
developer: Developer,
vesting: Vesting,
accountManagement: AccountManagement,
}

let fundsSoonNotificationId
Expand Down
16 changes: 16 additions & 0 deletions packages/desktop/views/dashboard/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@
},
]
: []),
...(features?.accountManagement?.enabled
? [
{
icon: IconEnum.Parchment,
label: localize('tabs.accountManagement'),
route: DashboardRoute.AccountManagement,
onClick: openAccountManagement,
},
]
: []),
...(features?.developerTools?.enabled && $activeProfile?.isDeveloperProfile
? [
{
Expand Down Expand Up @@ -97,6 +107,12 @@
resetAllRouters()
$dashboardRouter.goTo(DashboardRoute.Vesting)
}

function openAccountManagement(): void {
resetAllRouters()
$dashboardRouter.goTo(DashboardRoute.AccountManagement)
}

function resetAllRouters(): void {
$dashboardRouter.reset()
$collectiblesRouter.reset()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<script lang="ts">
import { selectedWallet } from '@core/wallet/stores'
import { Height, Pane } from '@ui'
</script>

{#if $selectedWallet}
<account-management-container
class="w-full h-full flex flex-nowrap p-8 relative flex-1 bg-gray-50 dark:bg-gray-900 space-x-4 justify-center"
>
<div class="flex space-x-4 max-w-7xl justify-center w-full">
{#key $selectedWallet?.id}
<left-pane class="flex flex-col w-1/3">
<Pane height={Height.Full}>Account List</Pane>
</left-pane>
<right-pane class="w-full h-full min-h-96 flex-1 space-y-4 flex flex-col">
<Pane height={Height.Full}>Account Details</Pane>
</right-pane>
{/key}
</div>
</account-management-container>
{/if}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as AccountManagement } from './AccountManagement.svelte'
1 change: 1 addition & 0 deletions packages/desktop/views/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export * from './governance'
export * from './settings'
export * from './vesting'
export * from './wallet'
export * from './account-management'

export { default as Dashboard } from './Dashboard.svelte'
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export enum DashboardRoute {
Governance = 'governance',
Settings = 'settings',
Vesting = 'vesting',
AccountManagement = 'accountManagement',
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { IFeatureFlag } from './feature-flag.interface'

export interface IAccountManagementFeatures extends IFeatureFlag {
accountList?: IFeatureFlag
accountDetails?: IFeatureFlag
}
2 changes: 2 additions & 0 deletions packages/shared/lib/features/interfaces/features.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { OnboardingFeatures } from '../types/onboarding-features.type'
import { ISettingsFeatures } from './settings-features.interface'
import { IWalletFeatures } from './wallet-features.interface'
import { IVestingFeatures } from './vesting-features.interface'
import { IAccountManagementFeatures } from './account-management-features.interface'

export interface IFeatures {
collectibles: ICollectiblesFeatures
Expand All @@ -16,4 +17,5 @@ export interface IFeatures {
settings: ISettingsFeatures
wallet: IWalletFeatures
vesting: IVestingFeatures
accountManagement: IAccountManagementFeatures
}
1 change: 1 addition & 0 deletions packages/shared/lib/features/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './account-management-features.interface'
export * from './collectibles-features.interface'
export * from './developer-features.interface'
export * from './feature-flag.interface'
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,8 @@
"developer": "Developer",
"tokens": "Tokens",
"activity": "Activity",
"vesting": "Vesting"
"vesting": "Vesting",
"accounts": "Accounts"
},
"pills": {
"stake": {
Expand Down
Loading