mirror of
https://github.com/voideditor/void
synced 2026-05-23 17:38:23 +00:00
Merge pull request #25 from sunmorgan/mdev
This commit is contained in:
commit
085e622c1b
1 changed files with 16 additions and 2 deletions
|
|
@ -241,6 +241,11 @@ const Sidebar = () => {
|
|||
|
||||
}, [messageStream])
|
||||
|
||||
//Clear code selection
|
||||
const clearSelection = () => {
|
||||
setSelection(null);
|
||||
};
|
||||
|
||||
return <>
|
||||
<div className="flex flex-col h-full w-full">
|
||||
<div className="flex-grow overflow-y-auto overflow-x-hidden p-4">
|
||||
|
|
@ -259,8 +264,17 @@ const Sidebar = () => {
|
|||
<FilesSelector files={files} setFiles={setFiles} />
|
||||
{/* selected code */}
|
||||
{!selection?.selectionStr ? null
|
||||
: <BlockCode text={selection?.selectionStr} disableApplyButton={true} />
|
||||
}
|
||||
: (
|
||||
<div className="relative">
|
||||
<button
|
||||
onClick={clearSelection}
|
||||
className="absolute top-2 right-2 text-white hover:text-gray-300 z-10"
|
||||
>
|
||||
X
|
||||
</button>
|
||||
<BlockCode text={selection.selectionStr} disableApplyButton={true} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<form
|
||||
ref={formRef}
|
||||
|
|
|
|||
Loading…
Reference in a new issue