|
8 | 8 | import ResponsiveTable from "$lib/components/ui/ResponsiveTable.svelte";
|
9 | 9 | import Separator from "$lib/components/ui/Separator.svelte";
|
10 | 10 | import UsdValueBanner from "$lib/components/ui/UsdValueBanner.svelte";
|
11 |
| - import { OWN_CANISTER_ID_TEXT } from "$lib/constants/canister-ids.constants"; |
| 11 | + import { |
| 12 | + abandonedProjectsCanisterId, |
| 13 | + OWN_CANISTER_ID_TEXT, |
| 14 | + } from "$lib/constants/canister-ids.constants"; |
12 | 15 | import { authSignedInStore } from "$lib/derived/auth.derived";
|
13 | 16 | import { icpSwapUsdPricesStore } from "$lib/derived/icp-swap.derived";
|
14 | 17 | import { selectableUniversesStore } from "$lib/derived/selectable-universes.derived";
|
|
30 | 33 | sortTableProjects,
|
31 | 34 | } from "$lib/utils/staking.utils";
|
32 | 35 | import { IconNeuronsPage } from "@dfinity/gix-components";
|
33 |
| - import { TokenAmountV2, isNullish } from "@dfinity/utils"; |
| 36 | + import { isNullish, TokenAmountV2 } from "@dfinity/utils"; |
34 | 37 | import { createEventDispatcher } from "svelte";
|
35 | 38 |
|
36 | 39 | $: if ($authSignedInStore) {
|
37 | 40 | loadIcpSwapTickers();
|
38 | 41 | }
|
39 |
| - const commonColumns: ProjectsTableColumn[] = [ |
| 42 | + let commonColumns: ProjectsTableColumn[] = []; |
| 43 | + $: commonColumns = [ |
40 | 44 | {
|
41 | 45 | id: "stake",
|
42 | 46 | title: $i18n.neuron_detail.stake,
|
|
106 | 110 | ...commonColumns,
|
107 | 111 | ];
|
108 | 112 |
|
| 113 | + let sunsettedSnsColumns: ProjectsTableColumn[] = []; |
| 114 | + $: sunsettedSnsColumns = [ |
| 115 | + { |
| 116 | + id: "title", |
| 117 | + title: $i18n.staking.nervous_systems_sns_sunset, |
| 118 | + cellComponent: ProjectTitleCell, |
| 119 | + alignment: "left", |
| 120 | + templateColumns: ["2fr"], |
| 121 | + }, |
| 122 | + { |
| 123 | + title: "", |
| 124 | + alignment: "left", |
| 125 | + templateColumns: ["1fr"], |
| 126 | + }, |
| 127 | + ]; |
| 128 | +
|
109 | 129 | let tableProjects: TableProject[];
|
110 | 130 | $: tableProjects = getTableProjects({
|
111 | 131 | universes: $selectableUniversesStore,
|
|
153 | 173 | );
|
154 | 174 |
|
155 | 175 | let snsNeurons: TableProject[] = [];
|
156 |
| - $: snsNeurons = sortedTableProjects.filter( |
157 |
| - (project) => project.universeId !== OWN_CANISTER_ID_TEXT |
| 176 | + $: snsNeurons = sortedTableProjects |
| 177 | + .filter((p) => p.universeId !== OWN_CANISTER_ID_TEXT) |
| 178 | + .filter((p) => !abandonedProjectsCanisterId.includes(p.universeId)); |
| 179 | +
|
| 180 | + let sunsetSns: TableProject[] = []; |
| 181 | + $: sunsetSns = sortedTableProjects.filter((p) => |
| 182 | + abandonedProjectsCanisterId.includes(p.universeId) |
158 | 183 | );
|
159 | 184 |
|
160 | 185 | const dispatcher = createEventDispatcher();
|
|
192 | 217 | columns={snsColumns}
|
193 | 218 | on:nnsAction={handleAction}
|
194 | 219 | />
|
| 220 | + |
| 221 | + {#if sunsetSns.length > 0} |
| 222 | + <ResponsiveTable tableData={sunsetSns} columns={sunsettedSnsColumns} /> |
| 223 | + {/if} |
195 | 224 | {:else}
|
196 | 225 | <ResponsiveTable
|
197 | 226 | tableData={nnsNeurons}
|
|
239 | 268 | </svelte:fragment>
|
240 | 269 | </ResponsiveTable>
|
241 | 270 | {/if}
|
| 271 | + |
| 272 | + {#if $hideZeroNeuronsStore !== "hide" && sunsetSns.length > 0} |
| 273 | + <ResponsiveTable tableData={sunsetSns} columns={sunsettedSnsColumns} /> |
| 274 | + {/if} |
242 | 275 | {/if}
|
243 | 276 | {:else if !$authSignedInStore}
|
244 | 277 | <ResponsiveTable
|
|
0 commit comments