diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-08-28 20:01:35 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-08-28 20:01:35 -0700 |
commit | 36d517e37d87b1bd39d6027577714b60c32e81e9 (patch) | |
tree | 77fc0464d3a32c78d36b0687303a7c317f44a15f /extension/react-app/src/components | |
parent | 48b8f1f0ad89a2b4e35f49c360576dd5aa99a7c0 (diff) | |
download | sncontinue-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/src/components')
-rw-r--r-- | extension/react-app/src/components/ContinueButton.tsx | 25 |
1 files changed, 23 insertions, 2 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" |