-
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.
Merge remote-tracking branch 'origin/develop' into 2362-move-polling-…
…of-the-network-health-and-status-inside-the-respective-classes
- Loading branch information
Showing
21 changed files
with
238 additions
and
110 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
29 changes: 29 additions & 0 deletions
29
packages/desktop/lib/electron/managers/json-file.manager.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { IError } from '@core/error/interfaces' | ||
import { app } from 'electron' | ||
import fs from 'fs' | ||
import path from 'path' | ||
|
||
export class JsonFileManager { | ||
public static saveJsonToFile(filename: string, data: object): void { | ||
try { | ||
fs.writeFileSync(JsonFileManager.getFilePath(filename), JSON.stringify(data)) | ||
} catch (err) { | ||
console.error(err) | ||
} | ||
} | ||
|
||
public static loadJsonFromFile(filename: string): object | undefined { | ||
try { | ||
return JSON.parse(fs.readFileSync(JsonFileManager.getFilePath(filename)).toString()) | ||
} catch (err) { | ||
if (!(err as IError).message?.includes('ENOENT')) { | ||
console.error(err) | ||
} | ||
} | ||
} | ||
|
||
private static getFilePath(filename: string): string { | ||
const userDataPath = app.getPath('userData') | ||
return path.join(userDataPath, filename) | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
packages/desktop/views/dashboard/collectibles/components/CollectiblesTabs.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,13 @@ | ||
<script lang="ts"> | ||
import { Tabs } from '@bloomwalletio/ui' | ||
import { COLLECTIBLES_TABS } from '@core/nfts' | ||
import { selectedCollectiblesTab } from '@core/nfts/stores' | ||
const selectedIndex = COLLECTIBLES_TABS.findIndex((tab) => tab.key === $selectedCollectiblesTab?.key) | ||
</script> | ||
|
||
{#if COLLECTIBLES_TABS.length > 1} | ||
<div class="w-64"> | ||
<Tabs {selectedIndex} bind:selectedTab={$selectedCollectiblesTab} tabs={COLLECTIBLES_TABS} /> | ||
</div> | ||
{/if} |
3 changes: 2 additions & 1 deletion
3
packages/desktop/views/dashboard/collectibles/components/index.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,2 +1,3 @@ | ||
export { default as Irc27CollectibleDetails } from './Irc27CollectibleDetails.svelte' | ||
export { default as CollectiblesTabs } from './CollectiblesTabs.svelte' | ||
export { default as Erc721CollectibleDetails } from './Erc721CollectibleDetails.svelte' | ||
export { default as Irc27CollectibleDetails } from './Irc27CollectibleDetails.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
73 changes: 73 additions & 0 deletions
73
packages/desktop/views/dashboard/collectibles/views/CollectionsGalleryView.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,73 @@ | ||
<script lang="ts"> | ||
import { Button, IconName, Pill, Text } from '@bloomwalletio/ui' | ||
import { CollectiblesListMenu, EmptyListPlaceholder } from '@components' | ||
import { Filter } from '@components/filter' | ||
import { localize } from '@core/i18n' | ||
import { PopupId, openPopup } from '@desktop/auxiliary/popup' | ||
import features from '@features/features' | ||
import { SearchInput } from '@ui' | ||
import { writable } from 'svelte/store' | ||
import { CollectiblesTabs } from '../components' | ||
function onReceiveClick(): void { | ||
openPopup({ | ||
id: PopupId.ReceiveAddress, | ||
}) | ||
} | ||
// MOCKS | ||
const collections: { name: string }[] = [] | ||
let collectionSearchTerm = '' | ||
const collectionFilter = writable(undefined) | ||
const ownedCollections = collections | ||
let queriedCollections: typeof collections = [] | ||
$: collectionSearchTerm, | ||
$collectionFilter, | ||
(queriedCollections = ownedCollections | ||
.filter((collection) => collection) | ||
.sort((collection1, collection2) => | ||
collection1.name.toLowerCase().localeCompare(collection2.name.toLowerCase()) | ||
)) | ||
</script> | ||
|
||
<collections-gallery-view class="flex flex-col w-full h-full gap-4"> | ||
<header class="flex flex-row items-center justify-between"> | ||
<div class="flex flex-row text-left gap-2 items-center flex-1"> | ||
<Text type="h6">{localize('views.collectibles.collectionsGallery.title')}</Text> | ||
<Pill color="neutral"> | ||
<Text textColor="secondary">{String(queriedCollections.length ?? '')}</Text> | ||
</Pill> | ||
</div> | ||
<CollectiblesTabs /> | ||
<div class="flex justify-end items-center gap-5 h-10 shrink-0 flex-1"> | ||
{#if collections.length} | ||
<SearchInput bind:value={collectionSearchTerm} /> | ||
<Filter filterStore={collectionFilter} /> | ||
{/if} | ||
{#if features.collectibles.erc721.enabled} | ||
<CollectiblesListMenu /> | ||
{/if} | ||
</div> | ||
</header> | ||
{#if collections.length} | ||
{#if queriedCollections.length} | ||
<!-- <CollectionsGallery collections={queriedCollections} /> --> | ||
{:else} | ||
<div class="w-full h-full flex flex-col items-center justify-center"> | ||
<EmptyListPlaceholder | ||
title={localize('views.collectibles.collectionsGallery.noResults')} | ||
icon={IconName.Data} | ||
/> | ||
</div> | ||
{/if} | ||
{:else} | ||
<div class="w-full h-full flex flex-col items-center justify-center grow-1 gap-6"> | ||
<EmptyListPlaceholder | ||
title={localize('views.collectibles.collectionsGallery.emptyTitle')} | ||
subtitle={localize('views.collectibles.collectionsGallery.emptyDescription')} | ||
icon={IconName.Data} | ||
/> | ||
<Button text={localize('actions.getStarted')} on:click={onReceiveClick} /> | ||
</div> | ||
{/if} | ||
</collections-gallery-view> |
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,2 +1,3 @@ | ||
export { default as CollectiblesDetailsView } from './CollectiblesDetailsView.svelte' | ||
export { default as CollectiblesGalleryView } from './CollectiblesGalleryView.svelte' | ||
export { default as CollectionsGalleryView } from './CollectionsGalleryView.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
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
Oops, something went wrong.