Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add mobile tokens list (#4994)
* feat: add tokens list * chore: update feature flags for mobile Co-authored-by: paul-boegelsack <paul.boegelsack@iota.org>
- Loading branch information
1 parent
66230d4
commit a05cadf
Showing
8 changed files
with
87 additions
and
25 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,35 @@ | ||
<script lang="typescript"> | ||
import { localize } from '@core/i18n' | ||
import { IAccountAssets, IAsset } from '@core/wallet' | ||
import VirtualList from '@sveltejs/svelte-virtual-list' | ||
import { AssetTile, Text } from 'shared/components' | ||
export let assets: IAccountAssets | ||
let assetList: IAsset[] | ||
$: assets, (assetList = getAssetList()) | ||
function getAssetList(): IAsset[] { | ||
const list = [] | ||
if (assets?.baseCoin) { | ||
list.push(assets.baseCoin) | ||
} | ||
list.push(...assets?.nativeTokens) | ||
return list | ||
} | ||
</script> | ||
|
||
{#if assets} | ||
<div class="asset-list h-full flex flex-auto flex-col flex-grow flex-shrink-0"> | ||
{#if assetList.length > 0} | ||
<VirtualList items={assetList} let:item> | ||
<AssetTile classes="mb-2" onClick={() => {}} asset={item} /> | ||
</VirtualList> | ||
{:else} | ||
<div class="h-full flex flex-col items-center justify-center text-center"> | ||
<Text secondary>{localize('general.noAssets')}</Text> | ||
</div> | ||
{/if} | ||
</div> | ||
{/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="typescript"> | ||
import { appSettings } from '@core/app' | ||
let darkModeEnabled | ||
$: darkModeEnabled = $appSettings.darkMode | ||
</script> | ||
|
||
<tab-pane | ||
class:darkmode={darkModeEnabled} | ||
class="w-full overflow-y-auto flex flex-auto h-1 p-5 pb-0 bg-white dark:bg-gray-800 rounded-t-2xl" | ||
> | ||
<slot /> | ||
</tab-pane> | ||
|
||
<style type="text/scss"> | ||
tab-pane { | ||
box-shadow: 0px 4px 4px rgb(0 0 0 / 25%), 0px 2px 12px rgb(0 25 66 / 10%); | ||
&.darkmode { | ||
box-shadow: 0px 4px 4px rgb(0 0 0 / 25%), 0px 2px 12px rgb(0 25 66 / 20%); | ||
} | ||
} | ||
</style> |
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,5 +1,7 @@ | ||
export * from './buttons' | ||
|
||
export { default as AssetList } from './AssetList.svelte' | ||
export { default as OnboardingLayout } from './OnboardingLayout.svelte' | ||
export { default as RecoveryPhrase } from './RecoveryPhrase.svelte' | ||
export { default as Route } from './Route.svelte' | ||
export { default as TabPane } from './TabPane.svelte' | ||
|
||
export * from './buttons' |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
<h1>TokensTab</h1> | ||
<script lang="typescript"> | ||
import { selectedAccountAssets } from '@core/wallet' | ||
import { AssetList } from '../../../../../mobile/components' | ||
</script> | ||
|
||
<AssetList assets={$selectedAccountAssets} /> |