diff --git a/gui/src/components/AccountDialog.tsx b/gui/src/components/AccountDialog.tsx index 7d9238c7b..cfd712549 100644 --- a/gui/src/components/AccountDialog.tsx +++ b/gui/src/components/AccountDialog.tsx @@ -5,10 +5,11 @@ import { } from "@heroicons/react/24/outline"; import { UserCircleIcon as UserCircleIconSolid } from "@heroicons/react/24/solid"; import { ProfileDescription } from "core/config/ConfigHandler"; -import { Fragment, useContext, useState } from "react"; +import { Fragment, useContext, useRef, useState } from "react"; import ReactDOM from "react-dom"; import styled from "styled-components"; import { + Button, defaultBorderRadius, lightGray, vscBackground, @@ -118,102 +119,97 @@ function AccountDialog() { controlServerBetaEnabled, } = useAuth(); - const topDiv = document.getElementById("profile-select-top-div"); + // These shouldn't usually show but just to be safe + if (!session?.account?.id) { + return ( +
+

Account

+

Not signed in

+ +
+ ); + } + + if (!controlServerBetaEnabled) { + return ( +
+

Account

+

+ Continue for teams is not enabled. You can enable it in your IDE + settings +

+

Using local config.

+ +
+ ); + } + + const topDiv = useRef(null); return (
-
-

Profiles

- {/* -

- Continue pre-indexes many common documentation sites, but if there's - one you don't see in the dropdown, enter the URL here. -

- -

- Continue's indexing engine will crawl the site and generate embeddings - so that you can ask questions. -

*/} -
- - {controlServerBetaEnabled && session?.account?.id && ( - { - ideMessenger.post("didChangeSelectedProfile", { id }); - }} - > -
- - {selectedProfile?.title} -
-
- - )} - - {controlServerBetaEnabled && - (session?.account ? ( - - - - ) : ( - - - - ))} + + , + topDiv.current, + )} + { + ideMessenger.post("didChangeSelectedProfile", { id }); + }} + > +
+ + {selectedProfile?.title} +
+
+
+
+
+
+ {session.account.label === "" + ? "Signed in" + : `Signed in as ${session.account.label}`} + +
); } diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index aaf0b757e..173ee7368 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -52,14 +52,6 @@ const GridDiv = styled.div` overflow-x: visible; `; -const ModelDropdownPortalDiv = styled.div` - background-color: ${vscInputBackground}; - position: relative; - margin-left: 8px; - z-index: 200; - font-size: ${getFontSize()}; -`; - const ProfileDropdownPortalDiv = styled.div` background-color: ${vscInputBackground}; position: relative; @@ -266,7 +258,6 @@ const Layout = () => {
)} -