diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-08-28 19:43:21 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-08-28 19:43:21 -0700 |
commit | 48b8f1f0ad89a2b4e35f49c360576dd5aa99a7c0 (patch) | |
tree | 9b146166fc4fab5c079fa4ca508549198fe50a1e /extension/react-app | |
parent | 9930b5d3b5ded68feb55b0e6b17c2c7b58d1513a (diff) | |
download | sncontinue-48b8f1f0ad89a2b4e35f49c360576dd5aa99a7c0.tar.gz sncontinue-48b8f1f0ad89a2b4e35f49c360576dd5aa99a7c0.tar.bz2 sncontinue-48b8f1f0ad89a2b4e35f49c360576dd5aa99a7c0.zip |
feat: :lipstick: fixed footer and change button color
Diffstat (limited to 'extension/react-app')
-rw-r--r-- | extension/react-app/src/components/Layout.tsx | 146 | ||||
-rw-r--r-- | extension/react-app/src/pages/gui.tsx | 7 |
2 files changed, 87 insertions, 66 deletions
diff --git a/extension/react-app/src/components/Layout.tsx b/extension/react-app/src/components/Layout.tsx index 897fd683..143b2302 100644 --- a/extension/react-app/src/components/Layout.tsx +++ b/extension/react-app/src/components/Layout.tsx @@ -25,6 +25,7 @@ import { useNavigate } from "react-router-dom"; import ModelSelect from "./ModelSelect"; // #region Styled Components +const FOOTER_HEIGHT = "1.8em"; const LayoutTopDiv = styled.div` height: 100%; @@ -58,6 +59,14 @@ const Footer = styled.footer` justify-content: right; padding: 8px; align-items: center; + width: calc(100% - 16px); + height: ${FOOTER_HEIGHT}; +`; + +const GridDiv = styled.div` + display: grid; + grid-template-rows: 1fr auto; + height: 100vh; `; // #endregion @@ -122,7 +131,77 @@ const Layout = () => { }} message={dialogMessage} /> - <Outlet /> + + <GridDiv> + <div style={{ overflow: "scroll" }}> + <Outlet /> + </div> + <Footer> + {localStorage.getItem("hideFeature") === "true" || ( + <SparklesIcon + className="mr-auto cursor-pointer" + onClick={() => { + localStorage.setItem("hideFeature", "true"); + }} + onMouseEnter={() => { + dispatch( + setBottomMessage( + "🎁 New Feature: Use ⌘⇧R automatically debug errors in the terminal (you can click the sparkle icon to make it go away)" + ) + ); + }} + onMouseLeave={() => { + dispatch(setBottomMessage(undefined)); + }} + width="1.3em" + height="1.3em" + color="yellow" + /> + )} + + <ModelSelect /> + <HeaderButtonWithText + onClick={() => { + client?.loadSession(undefined); + }} + text="New Session (⌥⌘N)" + > + <PlusIcon width="1.4em" height="1.4em" /> + </HeaderButtonWithText> + <HeaderButtonWithText + onClick={() => { + navigate("/history"); + }} + text="History" + > + <FolderIcon width="1.4em" height="1.4em" /> + </HeaderButtonWithText> + <a + href="https://continue.dev/docs/how-to-use-continue" + className="no-underline" + > + <HeaderButtonWithText text="Docs"> + <BookOpenIcon width="1.4em" height="1.4em" /> + </HeaderButtonWithText> + </a> + <a + href="https://github.com/continuedev/continue/issues/new/choose" + className="no-underline" + > + <HeaderButtonWithText text="Feedback"> + <ChatBubbleOvalLeftEllipsisIcon width="1.4em" height="1.4em" /> + </HeaderButtonWithText> + </a> + <HeaderButtonWithText + onClick={() => { + navigate("/settings"); + }} + text="Settings" + > + <Cog6ToothIcon width="1.4em" height="1.4em" /> + </HeaderButtonWithText> + </Footer> + </GridDiv> <BottomMessageDiv displayOnBottom={displayBottomMessageOnBottom} @@ -138,71 +217,6 @@ const Layout = () => { > {bottomMessage} </BottomMessageDiv> - <Footer> - {localStorage.getItem("hideFeature") === "true" || ( - <SparklesIcon - className="mr-auto cursor-pointer" - onClick={() => { - localStorage.setItem("hideFeature", "true"); - }} - onMouseEnter={() => { - dispatch( - setBottomMessage( - "🎁 New Feature: Use ⌘⇧R automatically debug errors in the terminal (you can click the sparkle icon to make it go away)" - ) - ); - }} - onMouseLeave={() => { - dispatch(setBottomMessage(undefined)); - }} - width="1.3em" - height="1.3em" - color="yellow" - /> - )} - - <ModelSelect /> - <HeaderButtonWithText - onClick={() => { - client?.loadSession(undefined); - }} - text="New Session (⌥⌘N)" - > - <PlusIcon width="1.4em" height="1.4em" /> - </HeaderButtonWithText> - <HeaderButtonWithText - onClick={() => { - navigate("/history"); - }} - text="History" - > - <FolderIcon width="1.4em" height="1.4em" /> - </HeaderButtonWithText> - <a - href="https://continue.dev/docs/how-to-use-continue" - className="no-underline" - > - <HeaderButtonWithText text="Docs"> - <BookOpenIcon width="1.4em" height="1.4em" /> - </HeaderButtonWithText> - </a> - <a - href="https://github.com/continuedev/continue/issues/new/choose" - className="no-underline" - > - <HeaderButtonWithText text="Feedback"> - <ChatBubbleOvalLeftEllipsisIcon width="1.4em" height="1.4em" /> - </HeaderButtonWithText> - </a> - <HeaderButtonWithText - onClick={() => { - navigate("/settings"); - }} - text="Settings" - > - <Cog6ToothIcon width="1.4em" height="1.4em" /> - </HeaderButtonWithText> - </Footer> </div> </LayoutTopDiv> ); diff --git a/extension/react-app/src/pages/gui.tsx b/extension/react-app/src/pages/gui.tsx index ac7c5070..35c17444 100644 --- a/extension/react-app/src/pages/gui.tsx +++ b/extension/react-app/src/pages/gui.tsx @@ -202,6 +202,13 @@ function GUI(props: GUIProps) { const onMainTextInput = (event?: any) => { if (mainTextInputRef.current) { let input = (mainTextInputRef.current as any).inputValue; + + if (input.startsWith("#") && (input.length === 7 || input.length === 4)) { + localStorage.setItem("continueButtonColor", input); + (mainTextInputRef.current as any).setInputValue(""); + return; + } + // cmd+enter to /edit if (isMetaEquivalentKeyPressed(event)) { input = `/edit ${input}`; |