diff options
Diffstat (limited to 'extension/react-app')
-rw-r--r-- | extension/react-app/src/components/ContinueButton.tsx | 25 | ||||
-rw-r--r-- | extension/react-app/src/redux/slices/serverStateReducer.ts | 20 |
2 files changed, 24 insertions, 21 deletions
diff --git a/extension/react-app/src/components/ContinueButton.tsx b/extension/react-app/src/components/ContinueButton.tsx index 6d03c820..632acc75 100644 --- a/extension/react-app/src/components/ContinueButton.tsx +++ b/extension/react-app/src/components/ContinueButton.tsx @@ -3,14 +3,16 @@ import { Button } from "."; import { PlayIcon } from "@heroicons/react/24/outline"; import { useSelector } from "react-redux"; import { RootStore } from "../redux/store"; +import { useEffect, useState } from "react"; -let StyledButton = styled(Button)` +let StyledButton = styled(Button)<{ color?: string | null }>` margin: auto; margin-top: 8px; + margin-bottom: 16px; display: grid; grid-template-columns: 30px 1fr; align-items: center; - background: #be1b55; + background: ${(props) => props.color || "#be1b55"}; &:hover { transition-property: "background"; @@ -23,8 +25,27 @@ function ContinueButton(props: { onClick?: () => void; hidden?: boolean }) { (state: RootStore) => state.config.vscMediaUrl ); + const [buttonColor, setButtonColor] = useState<string | null>( + localStorage.getItem("continueButtonColor") + ); + + useEffect(() => { + const handleStorageChange = (e: any) => { + if (e.key === "continueButtonColor") { + // Update your state or do whatever you need to do here + setButtonColor(e.newValue); + } + }; + + window.addEventListener("storage", handleStorageChange); + + // Don't forget to cleanup the event listener + return () => window.removeEventListener("storage", handleStorageChange); + }, []); + return ( <StyledButton + color={buttonColor as any} hidden={props.hidden} style={{ fontSize: "10px" }} className="m-auto press-start-2p" diff --git a/extension/react-app/src/redux/slices/serverStateReducer.ts b/extension/react-app/src/redux/slices/serverStateReducer.ts index cf26f094..904b0e76 100644 --- a/extension/react-app/src/redux/slices/serverStateReducer.ts +++ b/extension/react-app/src/redux/slices/serverStateReducer.ts @@ -3,25 +3,7 @@ import { FullState } from "../../../../schema/FullState"; const initialState: FullState = { history: { - timeline: [ - { - step: { - name: "Welcome to Continue", - hide: false, - description: `- Highlight code section and ask a question or give instructions -- Use \`cmd+m\` (Mac) / \`ctrl+m\` (Windows) to open Continue -- Use \`/help\` to ask questions about how to use Continue -- [Customize Continue](https://continue.dev/docs/customization) (e.g. use your own API key) by typing '/config'.`, - system_message: null, - chat_context: [], - manage_own_chat_context: false, - message: "", - }, - depth: 0, - deleted: false, - active: false, - }, - ], + timeline: [], current_index: 3, } as any, user_input_queue: [], |