summaryrefslogtreecommitdiff
path: root/extension/react-app
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-28 20:01:35 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-28 20:01:35 -0700
commit36d517e37d87b1bd39d6027577714b60c32e81e9 (patch)
tree77fc0464d3a32c78d36b0687303a7c317f44a15f /extension/react-app
parent48b8f1f0ad89a2b4e35f49c360576dd5aa99a7c0 (diff)
downloadsncontinue-36d517e37d87b1bd39d6027577714b60c32e81e9.tar.gz
sncontinue-36d517e37d87b1bd39d6027577714b60c32e81e9.tar.bz2
sncontinue-36d517e37d87b1bd39d6027577714b60c32e81e9.zip
feat: :sparkles: text-gen-webui, cleaning config and welcome
Diffstat (limited to 'extension/react-app')
-rw-r--r--extension/react-app/src/components/ContinueButton.tsx25
-rw-r--r--extension/react-app/src/redux/slices/serverStateReducer.ts20
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: [],