Merge pull request #25 from sunmorgan/mdev
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user