diff --git a/client/web/src/components/app.tsx b/client/web/src/components/app.tsx index b8ec34a6c..aefa81a7d 100644 --- a/client/web/src/components/app.tsx +++ b/client/web/src/components/app.tsx @@ -13,47 +13,64 @@ import DeviceDetailsView from "./views/device-details-view" export default function App() { const { data: auth, loading: loadingAuth, newSession } = useAuth() + + return ( +
+ {loadingAuth ? ( +
Loading...
// TODO(sonia): add a loading view + ) : ( + + )} +
+ ) +} + +function WebClient({ + auth, + newSession, +}: { + auth?: AuthResponse + newSession: () => Promise +}) { const { data, refreshData, updateNode } = useNodeData() useEffect(() => { refreshData() }, [auth, refreshData]) + if (!data) { + return
Loading...
// TODO(sonia): add a loading view + } + return ( -
- {loadingAuth || !data ? ( -
Loading...
// TODO(sonia): add a loading view - ) : ( - <> - {/* TODO(sonia): get rid of the conditions here once full/readonly - * views live on same components */} - {data.DebugMode === "full" && auth?.ok &&
} - - - + <> + {/* TODO(sonia): get rid of the conditions here once full/readonly + * views live on same components */} + {data.DebugMode === "full" && auth?.ok &&
} + + + + + {data.DebugMode !== "" && ( + <> + + - {data.DebugMode !== "" && ( - <> - - - - {/* TODO */}Subnet router - {/* TODO */}Tailscale SSH server - {/* TODO */}Share local content - - )} - -

Page not found

-
-
- - )} -
+ {/* TODO */}Subnet router + {/* TODO */}Tailscale SSH server + {/* TODO */}Share local content + + )} + +

Page not found

+
+ + ) }