From b7135b56a749cfb0318a6518698aa343bf92eae8 Mon Sep 17 00:00:00 2001 From: Antonio Ventilii <32648800+AntonioVentilii@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:34:41 +0100 Subject: [PATCH] feat(frontend): New Activity page (#3352) # Note Duplicate of #3316 , because I changed account. # Motivation We want to create a new page with the list of the user activities, mainly the unified transactions. As first step we create the route similar to the the main page route. In the layout we set a `MultipleListener` for the entire list of tokens enabled for the current network, so that the transactions are updated. This reflects what is being done with the transaction page specific to a token, where there is a single `Listener`. ![Screenshot 2024-11-04 at 20 01 53](https://github.com/user-attachments/assets/d8e46371-27cf-45ec-91b7-18c5036485cc) --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- src/frontend/src/lib/derived/network-tokens.derived.ts | 2 +- src/frontend/src/routes/(app)/activity/+page.svelte | 9 +++++++++ src/frontend/src/routes/(app)/activity/+page.ts | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/frontend/src/routes/(app)/activity/+page.svelte create mode 100644 src/frontend/src/routes/(app)/activity/+page.ts diff --git a/src/frontend/src/lib/derived/network-tokens.derived.ts b/src/frontend/src/lib/derived/network-tokens.derived.ts index 69b48f9031..592fbe729a 100644 --- a/src/frontend/src/lib/derived/network-tokens.derived.ts +++ b/src/frontend/src/lib/derived/network-tokens.derived.ts @@ -10,7 +10,7 @@ import { derived, type Readable } from 'svelte/store'; /** * All user-enabled tokens matching the selected network or chain fusion. */ -const enabledNetworkTokens: Readable = derived( +export const enabledNetworkTokens: Readable = derived( [enabledTokens, selectedNetwork, pseudoNetworkChainFusion], filterTokensForSelectedNetwork ); diff --git a/src/frontend/src/routes/(app)/activity/+page.svelte b/src/frontend/src/routes/(app)/activity/+page.svelte new file mode 100644 index 0000000000..9171a2114d --- /dev/null +++ b/src/frontend/src/routes/(app)/activity/+page.svelte @@ -0,0 +1,9 @@ + + + + + Working on it... + diff --git a/src/frontend/src/routes/(app)/activity/+page.ts b/src/frontend/src/routes/(app)/activity/+page.ts new file mode 100644 index 0000000000..b12deea76a --- /dev/null +++ b/src/frontend/src/routes/(app)/activity/+page.ts @@ -0,0 +1,10 @@ +import { type RouteParams } from '$lib/utils/nav.utils'; +import type { LoadEvent } from '@sveltejs/kit'; +import type { PageLoad } from './$types'; + +// We reset the data because the "activity" route operates without a network or token selected. +export const load: PageLoad = (_$event: LoadEvent): RouteParams => ({ + token: null, + network: null, + uri: null +});