diff --git a/frontend/app/view/preview/directorypreview.scss b/frontend/app/view/preview/directorypreview.scss index e51bcb0f5..4a5b5046b 100644 --- a/frontend/app/view/preview/directorypreview.scss +++ b/frontend/app/view/preview/directorypreview.scss @@ -243,4 +243,10 @@ border: 1px solid rgba(255, 255, 255, 0.15); background: #212121; box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.3); + + .entry-manager-buttons { + display: flex; + flex-direction: row; + gap: 10px; + } } diff --git a/frontend/app/view/preview/directorypreview.tsx b/frontend/app/view/preview/directorypreview.tsx index ece692f7e..00ab63da5 100644 --- a/frontend/app/view/preview/directorypreview.tsx +++ b/frontend/app/view/preview/directorypreview.tsx @@ -1,6 +1,7 @@ // Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 +import { Button } from "@/app/element/button"; import { Input } from "@/app/element/input"; import { ContextMenuModel } from "@/app/store/contextmenu"; import { PLATFORM, atoms, createBlock, getApi, globalStore } from "@/app/store/global"; @@ -146,12 +147,21 @@ type EntryManagerOverlayProps = { entryManagerType: EntryManagerType; startingValue?: string; onSave: (newValue: string) => void; + onCancel?: () => void; style?: React.CSSProperties; getReferenceProps?: () => any; }; const EntryManagerOverlay = memo( - ({ entryManagerType, startingValue, onSave, forwardRef, style, getReferenceProps }: EntryManagerOverlayProps) => { + ({ + entryManagerType, + startingValue, + onSave, + onCancel, + forwardRef, + style, + getReferenceProps, + }: EntryManagerOverlayProps) => { const [value, setValue] = useState(startingValue); return (
@@ -168,7 +178,15 @@ const EntryManagerOverlay = memo( onSave(value); } }} - > + /> +
+
+ +
); @@ -870,6 +888,7 @@ function DirectoryPreview({ model }: DirectoryPreviewProps) { }} {...getReferenceProps()} onContextMenu={(e) => handleFileContextMenu(e)} + onClick={() => setEntryManagerProps(undefined)} > setEntryManagerProps(undefined)} /> )}