diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-17 13:33:29 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-17 13:33:29 -0700 |
commit | 1a647a7321a31d7ccf29f27e56c3df0828c3e9c8 (patch) | |
tree | 3e20e038d06449d6dff677566e1bdf6ed148eb96 /extension/react-app/src/components/PillButton.tsx | |
parent | 062b0872797fb4734ed36ea3a14f653dc685a86a (diff) | |
parent | d0dc7811eb71d9d53055a1aa684827502748b794 (diff) | |
download | sncontinue-1a647a7321a31d7ccf29f27e56c3df0828c3e9c8.tar.gz sncontinue-1a647a7321a31d7ccf29f27e56c3df0828c3e9c8.tar.bz2 sncontinue-1a647a7321a31d7ccf29f27e56c3df0828c3e9c8.zip |
Merge branch 'main' of https://github.com/continuedev/continue into anthropic
Diffstat (limited to 'extension/react-app/src/components/PillButton.tsx')
-rw-r--r-- | extension/react-app/src/components/PillButton.tsx | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/extension/react-app/src/components/PillButton.tsx b/extension/react-app/src/components/PillButton.tsx index d9d779d1..c24dba83 100644 --- a/extension/react-app/src/components/PillButton.tsx +++ b/extension/react-app/src/components/PillButton.tsx @@ -1,6 +1,11 @@ import { useContext, useState } from "react"; import styled from "styled-components"; -import { StyledTooltip, defaultBorderRadius, secondaryDark } from "."; +import { + StyledTooltip, + defaultBorderRadius, + secondaryDark, + vscForeground, +} from "."; import { Trash, PaintBrush, @@ -10,7 +15,7 @@ import { GUIClientContext } from "../App"; const Button = styled.button` border: none; - color: white; + color: ${vscForeground}; background-color: ${secondaryDark}; border-radius: ${defaultBorderRadius}; padding: 8px; @@ -27,7 +32,6 @@ const GridDiv = styled.div` height: 100%; display: grid; grid-gap: 0; - grid-template-columns: 1fr 1fr; align-items: center; border-radius: ${defaultBorderRadius}; @@ -69,6 +73,7 @@ interface PillButtonProps { editing: boolean; pinned: boolean; warning?: string; + onlyShowDelete?: boolean; } const PillButton = (props: PillButtonProps) => { @@ -105,19 +110,25 @@ const PillButton = (props: PillButtonProps) => { }} > {isHovered && ( - <GridDiv> - <ButtonDiv - data-tooltip-id={`edit-${props.index}`} - backgroundColor={"#8800aa55"} - onClick={() => { - client?.setEditingAtIndices([props.index]); - }} - > - <PaintBrush - style={{ margin: "auto" }} - width="1.6em" - ></PaintBrush> - </ButtonDiv> + <GridDiv + style={{ + gridTemplateColumns: props.onlyShowDelete ? "1fr" : "1fr 1fr", + }} + > + {props.onlyShowDelete || ( + <ButtonDiv + data-tooltip-id={`edit-${props.index}`} + backgroundColor={"#8800aa55"} + onClick={() => { + client?.setEditingAtIndices([props.index]); + }} + > + <PaintBrush + style={{ margin: "auto" }} + width="1.6em" + ></PaintBrush> + </ButtonDiv> + )} {/* <ButtonDiv data-tooltip-id={`pin-${props.index}`} @@ -148,8 +159,8 @@ const PillButton = (props: PillButtonProps) => { </Button> <StyledTooltip id={`edit-${props.index}`}> {props.editing - ? "Editing this range (with rest of file as context)" - : "Edit this range"} + ? "Editing this section (with entire file as context)" + : "Edit this section"} </StyledTooltip> <StyledTooltip id={`delete-${props.index}`}>Delete</StyledTooltip> {props.warning && ( |