diff --git a/apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx b/apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx index 2c87b522af2..447c3e3a4e9 100644 --- a/apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx +++ b/apps/wallet-dashboard/components/Dialogs/settings/SettingsDialog.tsx @@ -25,14 +25,12 @@ export function SettingsDialog({ return ( handleClose()}> - <> - {view === SettingsDialogView.SelectSetting && ( - - )} - {view === SettingsDialogView.NetworkSettings && ( - - )} - + {view === SettingsDialogView.SelectSetting && ( + + )} + {view === SettingsDialogView.NetworkSettings && ( + + )} ); } diff --git a/apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx b/apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx index cc9b573a9a9..9eb2d3a80d4 100644 --- a/apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx +++ b/apps/wallet-dashboard/components/Dialogs/settings/views/NetworkSelectorView.tsx @@ -19,6 +19,8 @@ export function NetworkSelectorView({ }: NetworkSelectorViewProps): JSX.Element { const clientContext = useIotaClientContext(); const activeNetwork = clientContext.network; + // Dashboard doesn't support RPCs yet + const networks = clientContext.networks as Record; async function handleNetworkChange(network: NetworkConfiguration) { if (activeNetwork === network.id) { @@ -27,25 +29,21 @@ export function NetworkSelectorView({ clientContext.selectNetwork(network.id); toast.success(`Switched to ${network.name}`); } + return (
- {Object.keys(clientContext.networks).map((network) => { - const networkConfig = clientContext.networks[ - network - ] as NetworkConfiguration; - return ( -
- handleNetworkChange(networkConfig)} - /> -
- ); - })} + {Object.values(networks).map((network) => ( +
+ handleNetworkChange(network)} + /> +
+ ))}
diff --git a/apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx b/apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx index 5ed55017ab9..7e9d484de73 100644 --- a/apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx +++ b/apps/wallet-dashboard/components/Dialogs/settings/views/SettingsListView.tsx @@ -26,17 +26,16 @@ interface SettingsListViewProps { export function SettingsListView({ handleClose, setView }: SettingsListViewProps): JSX.Element { const { network } = useIotaClientContext(); const { name: networkName } = getNetwork(network); - function onSelectSettingClick(view: SettingsDialogView): void { - setView(view); - } + const MENU_ITEMS = [ { title: 'Network', subtitle: networkName, icon: , - onClick: () => onSelectSettingClick(SettingsDialogView.NetworkSettings), + onClick: () => setView(SettingsDialogView.NetworkSettings), }, ]; + return (