diff --git a/extensions/void/src/sidebar/MarkdownRender/BlockCode.tsx b/extensions/void/src/sidebar/MarkdownRender/BlockCode.tsx index 37d5b5bd..1ce07d80 100644 --- a/extensions/void/src/sidebar/MarkdownRender/BlockCode.tsx +++ b/extensions/void/src/sidebar/MarkdownRender/BlockCode.tsx @@ -1,5 +1,6 @@ -import React, { useCallback, useEffect, useState } from "react" +import React, { ReactNode, useCallback, useEffect, useState } from "react" import { getVSCodeAPI } from "../getVscodeApi" +import { classNames } from "../utils" enum CopyButtonState { Copy = "Copy", @@ -12,10 +13,14 @@ const COPY_FEEDBACK_TIMEOUT = 1000 // code block with Apply button at top const BlockCode = ({ text, + toolbar, hideToolbar = false, + className, }: { text: string + toolbar?: ReactNode hideToolbar?: boolean + className?: string }) => { const [copyButtonState, setCopyButtonState] = useState(CopyButtonState.Copy) @@ -38,34 +43,40 @@ const BlockCode = ({ ) }, [text]) + const defaultToolbar = ( + <> + + + + ) + return (
{!hideToolbar && (
-
- - -
+
{toolbar || defaultToolbar}
)}
-
{text}
+
{text}
) diff --git a/extensions/void/src/sidebar/Sidebar.tsx b/extensions/void/src/sidebar/Sidebar.tsx index 1aefaf47..3af8540a 100644 --- a/extensions/void/src/sidebar/Sidebar.tsx +++ b/extensions/void/src/sidebar/Sidebar.tsx @@ -220,23 +220,33 @@ const Sidebar = () => {
{/* selection */} -
+ {(files.length || selection?.selectionStr) &&
{/* selected files */} {/* selected code */} - {!selection?.selectionStr ? null - : ( -
- - -
+ + + + + )} /> )} -
+
}
+
{files.map((filename, i) => (