diff options
| author | Nate Sesti <sestinj@gmail.com> | 2023-06-18 18:55:14 -0700 | 
|---|---|---|
| committer | Nate Sesti <sestinj@gmail.com> | 2023-06-18 18:55:14 -0700 | 
| commit | ea8e812a9361a609c1d666bd518112196c6e64b0 (patch) | |
| tree | 31c0cf26a37be5d2684870ee4c096d5e8ddef913 /extension/react-app/src/components | |
| parent | c3e498c1d14044222636a7a24c4eff37cb827dd5 (diff) | |
| download | sncontinue-ea8e812a9361a609c1d666bd518112196c6e64b0.tar.gz sncontinue-ea8e812a9361a609c1d666bd518112196c6e64b0.tar.bz2 sncontinue-ea8e812a9361a609c1d666bd518112196c6e64b0.zip | |
posthog on data switch, fixed copy button
Diffstat (limited to 'extension/react-app/src/components')
| -rw-r--r-- | extension/react-app/src/components/CodeBlock.tsx | 7 | ||||
| -rw-r--r-- | extension/react-app/src/components/ComboBox.tsx | 9 | 
2 files changed, 14 insertions, 2 deletions
| diff --git a/extension/react-app/src/components/CodeBlock.tsx b/extension/react-app/src/components/CodeBlock.tsx index c4524a51..0aae0bbb 100644 --- a/extension/react-app/src/components/CodeBlock.tsx +++ b/extension/react-app/src/components/CodeBlock.tsx @@ -22,7 +22,7 @@ const StyledCopyButton = styled.button<{ visible: boolean }>`    /* position: relative; */    float: right;    border: none; -  background-color: transparent; +  background-color: ${secondaryDark};    cursor: pointer;    padding: 0;    /* margin: 4px; */ @@ -77,7 +77,10 @@ function CodeBlock(props: { language?: string; children: string }) {          setHovered(false);        }}      > -      <CopyButton visible={hovered} textToCopy={props.children} /> +      <CopyButton +        visible={hovered} +        textToCopy={(props.children as any).props.children[0]} +      />        <StyledCode>{props.children}</StyledCode>      </StyledPre>    ); diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx index ddc9d5dc..8c1f80e0 100644 --- a/extension/react-app/src/components/ComboBox.tsx +++ b/extension/react-app/src/components/ComboBox.tsx @@ -116,6 +116,15 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {          disabled={props.disabled}          placeholder="Type '/' to see available slash commands."          {...getInputProps({ +          onChange: (e) => { +            const target = e.target as HTMLTextAreaElement; +            // Update the height of the textarea to match the content, up to a max of 200px. +            target.style.height = "auto"; +            target.style.height = `${Math.min( +              target.scrollHeight, +              200 +            ).toString()}px`; +          },            onKeyDown: (event) => {              if (event.key === "Enter" && event.shiftKey) {                // Prevent Downshift's default 'Enter' behavior. | 
