diff --git a/extension/react-app/src/components/EditableDiv.tsx b/extension/react-app/src/components/EditableDiv.tsx new file mode 100644 index 000000000..a86bd6920 --- /dev/null +++ b/extension/react-app/src/components/EditableDiv.tsx @@ -0,0 +1,84 @@ +import styled from "styled-components"; +import { + defaultBorderRadius, + lightGray, + secondaryDark, + vscForeground, +} from "."; + +const Div = styled.div` + resize: none; + + padding: 8px; + font-size: 13px; + font-family: inherit; + border-radius: ${defaultBorderRadius}; + margin: 8px auto; + height: auto; + width: 100%; + background-color: ${secondaryDark}; + color: ${vscForeground}; + z-index: 1; + border: 1px solid transparent; + + &:focus { + outline: 1px solid ${lightGray}; + border: 1px solid transparent; + } + + &::placeholder { + color: ${lightGray}80; + } +`; + +const Span = styled.span<{ color?: string }>` + background-color: ${(props) => props.color || "#2cf8"}; + border-radius: ${defaultBorderRadius}; + padding: 2px 4px; +`; + +interface EditableDivProps { + onChange: (e: any) => void; + value?: string; +} + +function EditableDiv(props: EditableDivProps) { + return ( +