Update CodeToEditListItem.tsx

This commit is contained in:
Test 2024-12-02 13:29:59 -06:00
parent 804283e6c7
commit 83a20d7f8b

View file

@ -16,7 +16,6 @@ export interface CodeToEditListItemProps {
onClickFilename: (codeToEdit: CodeToEdit) => void;
}
// Easiest method to overwrite the top level styling of the markdown preview
const NoPaddingWrapper = styled.div`
> * {
margin: 0 !important;
@ -67,7 +66,7 @@ export default function CodeToEditListItem({
onClick={() => setShowCodeSnippet((showCodeSnippet) => !showCodeSnippet)}
>
<div
className={`hover:bg-lightgray hover:text-vsc-foreground flex justify-between rounded px-2 py-0.5 transition-colors hover:bg-opacity-20 ${showCodeSnippet && "text-vsc-foreground bg-lightgray bg-opacity-20"}`}
className={`hover:bg-lightgray hover:text-vsc-foreground flex items-center justify-between rounded px-2 py-0.5 transition-colors hover:bg-opacity-20 ${showCodeSnippet && "text-vsc-foreground bg-lightgray bg-opacity-20"}`}
>
<div className="flex w-4/5 min-w-0 items-center gap-0.5">
<FileIcon filename={code.filepath} height={"18px"} width={"18px"} />
@ -82,22 +81,20 @@ export default function CodeToEditListItem({
{title}
</span>
<span className="text-lightgray invisible flex-grow truncate text-xs group-hover:visible">
{" "}
{/* Added flex-grow */}
{fileSubpath}
</span>
</div>
</div>
<div className="invisible mt-0.5 flex gap-1.5 group-hover:visible">
<div className={isInsertion ? "hidden" : ""}>
<div className="invisible flex items-center gap-1.5 group-hover:visible">
<div className={`flex items-center ${isInsertion ? "hidden" : ""}`}>
{showCodeSnippet ? (
<ChevronDownIcon
onClick={(e) => {
e.stopPropagation();
setShowCodeSnippet(false);
}}
className="text-lightgray hover:bg-lightgray hover:text-vsc-foreground h-3.5 w-3.5 cursor-pointer rounded-md rounded-sm p-0.5 hover:bg-opacity-20"
className="text-lightgray hover:bg-lightgray hover:text-vsc-foreground h-3.5 w-3.5 cursor-pointer rounded-sm p-0.5 hover:bg-opacity-20"
/>
) : (
<ChevronRightIcon
@ -105,17 +102,19 @@ export default function CodeToEditListItem({
e.stopPropagation();
setShowCodeSnippet(true);
}}
className="text-lightgray hover:bg-lightgray hover:text-vsc-foreground h-3.5 w-3.5 cursor-pointer rounded-md rounded-sm p-0.5 hover:bg-opacity-20"
className="text-lightgray hover:bg-lightgray hover:text-vsc-foreground h-3.5 w-3.5 cursor-pointer rounded-sm p-0.5 hover:bg-opacity-20"
/>
)}
</div>
<XMarkIcon
onClick={(e) => {
e.stopPropagation();
onDelete(code);
}}
className="text-lightgray hover:bg-lightgray hover:text-vsc-foreground h-3.5 w-3.5 cursor-pointer rounded-md rounded-sm p-0.5 hover:bg-opacity-20"
/>
<div className="flex items-center">
<XMarkIcon
onClick={(e) => {
e.stopPropagation();
onDelete(code);
}}
className="text-lightgray hover:bg-lightgray hover:text-vsc-foreground h-3.5 w-3.5 cursor-pointer rounded-sm p-0.5 hover:bg-opacity-20"
/>
</div>
</div>
</div>