|
14 | 14 | import { selectableUniversesStore } from "$lib/derived/selectable-universes.derived";
|
15 | 15 | import { loadIcpSwapTickers } from "$lib/services/icp-swap.services";
|
16 | 16 | import { failedActionableSnsesStore } from "$lib/stores/actionable-sns-proposals.store";
|
| 17 | + import { ENABLE_NEW_TABLES } from "$lib/stores/feature-flags.store"; |
17 | 18 | import { hideZeroNeuronsStore } from "$lib/stores/hide-zero-neurons.store";
|
18 | 19 | import { i18n } from "$lib/stores/i18n";
|
19 | 20 | import { neuronsStore } from "$lib/stores/neurons.store";
|
|
43 | 44 | title: $i18n.staking.nervous_systems,
|
44 | 45 | cellComponent: ProjectTitleCell,
|
45 | 46 | alignment: "left",
|
46 |
| - templateColumns: ["minmax(min-content, max-content)"], |
| 47 | + templateColumns: ["2fr"], |
47 | 48 | comparator: $authSignedInStore ? compareByProject : undefined,
|
48 | 49 | },
|
49 |
| - { |
50 |
| - title: "", |
51 |
| - alignment: "left", |
52 |
| - templateColumns: ["1fr"], |
53 |
| - }, |
54 | 50 | {
|
55 | 51 | id: "stake",
|
56 | 52 | title: $i18n.neuron_detail.stake,
|
57 | 53 | cellComponent: ProjectStakeCell,
|
58 | 54 | alignment: "right",
|
59 |
| - templateColumns: ["max-content"], |
60 |
| - comparator: $authSignedInStore ? compareByStake : undefined, |
61 |
| - }, |
62 |
| - { |
63 |
| - title: "", |
64 |
| - alignment: "left", |
65 | 55 | templateColumns: ["1fr"],
|
| 56 | + comparator: $authSignedInStore ? compareByStake : undefined, |
66 | 57 | },
|
67 | 58 | {
|
68 | 59 | title: $i18n.neuron_detail.maturity_title,
|
69 | 60 | cellComponent: ProjectMaturityCell,
|
70 | 61 | alignment: "right",
|
71 |
| - templateColumns: ["max-content"], |
72 |
| - }, |
73 |
| - { |
74 |
| - title: "", |
75 |
| - alignment: "left", |
76 | 62 | templateColumns: ["1fr"],
|
77 | 63 | },
|
78 | 64 | {
|
79 | 65 | id: "neurons",
|
80 | 66 | title: $i18n.neurons.title,
|
81 | 67 | cellComponent: ProjectNeuronsCell,
|
82 | 68 | alignment: "right",
|
83 |
| - templateColumns: ["max-content"], |
| 69 | + templateColumns: ["1fr"], |
84 | 70 | comparator: $authSignedInStore ? compareByNeuron : undefined,
|
85 | 71 | },
|
86 | 72 | {
|
87 | 73 | title: "",
|
88 | 74 | cellComponent: ProjectActionsCell,
|
89 | 75 | alignment: "right",
|
90 |
| - templateColumns: ["max-content"], |
| 76 | + templateColumns: ["1fr"], |
91 | 77 | },
|
92 | 78 | ];
|
93 | 79 |
|
|
132 | 118 | (!("stakeInUsd" in project) || isNullish(project.stakeInUsd))
|
133 | 119 | );
|
134 | 120 |
|
| 121 | + let nnsNeurons: TableProject[] = []; |
| 122 | + $: nnsNeurons = sortedTableProjects.filter( |
| 123 | + (project) => project.universeId === OWN_CANISTER_ID_TEXT |
| 124 | + ); |
| 125 | +
|
| 126 | + let snsNeurons: TableProject[] = []; |
| 127 | + $: snsNeurons = sortedTableProjects.filter( |
| 128 | + (project) => project.universeId !== OWN_CANISTER_ID_TEXT |
| 129 | + ); |
| 130 | +
|
135 | 131 | const dispatcher = createEventDispatcher();
|
136 | 132 |
|
137 | 133 | const handleAction = ({
|
|
154 | 150 | </UsdValueBanner>
|
155 | 151 | {/if}
|
156 | 152 |
|
157 |
| - {#if !$authSignedInStore} |
| 153 | + {#if $ENABLE_NEW_TABLES} |
| 154 | + {#if !$authSignedInStore} |
| 155 | + <ResponsiveTable |
| 156 | + tableData={nnsNeurons} |
| 157 | + {columns} |
| 158 | + on:nnsAction={handleAction} |
| 159 | + /> |
| 160 | + |
| 161 | + <ResponsiveTable |
| 162 | + tableData={snsNeurons} |
| 163 | + {columns} |
| 164 | + on:nnsAction={handleAction} |
| 165 | + /> |
| 166 | + {:else} |
| 167 | + <ResponsiveTable |
| 168 | + tableData={nnsNeurons} |
| 169 | + {columns} |
| 170 | + on:nnsAction={handleAction} |
| 171 | + bind:order={$projectsTableOrderStore} |
| 172 | + displayTableSettings |
| 173 | + > |
| 174 | + <svelte:fragment slot="settings-popover"> |
| 175 | + <HideZeroNeuronsToggle /> |
| 176 | + <Separator spacing="none" /> |
| 177 | + </svelte:fragment> |
| 178 | + |
| 179 | + <div |
| 180 | + slot="last-row" |
| 181 | + class="last-row" |
| 182 | + class:hidden={!shouldHideProjectsWithoutNeurons} |
| 183 | + > |
| 184 | + {#if shouldHideProjectsWithoutNeurons} |
| 185 | + <div class="show-all-button-container"> |
| 186 | + {$i18n.staking.hide_no_neurons_table_hint} |
| 187 | + <button |
| 188 | + data-tid="show-all-button" |
| 189 | + class="ghost show-all" |
| 190 | + on:click={showAll} |
| 191 | + > |
| 192 | + {$i18n.staking.show_all}</button |
| 193 | + > |
| 194 | + </div> |
| 195 | + {/if} |
| 196 | + </div> |
| 197 | + </ResponsiveTable> |
| 198 | + |
| 199 | + {#if snsNeurons.length > 0} |
| 200 | + <ResponsiveTable |
| 201 | + tableData={snsNeurons} |
| 202 | + {columns} |
| 203 | + on:nnsAction={handleAction} |
| 204 | + bind:order={$projectsTableOrderStore} |
| 205 | + displayTableSettings |
| 206 | + > |
| 207 | + <svelte:fragment slot="settings-popover"> |
| 208 | + <HideZeroNeuronsToggle /> |
| 209 | + <Separator spacing="none" /> |
| 210 | + </svelte:fragment> |
| 211 | + </ResponsiveTable> |
| 212 | + {/if} |
| 213 | + {/if} |
| 214 | + {:else if !$authSignedInStore} |
158 | 215 | <ResponsiveTable
|
159 | 216 | tableData={sortedTableProjects}
|
160 | 217 | {columns}
|
|
0 commit comments