mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
refactor: update FixedToolbarButtons to conditionally render save button based on read-only state, and adjust dropdown menu styles for better usability
This commit is contained in:
parent
df3f724caf
commit
6af251a108
3 changed files with 21 additions and 19 deletions
|
|
@ -101,28 +101,30 @@ export function FixedToolbarButtons() {
|
|||
<LinkToolbarButton />
|
||||
</ToolbarGroup>
|
||||
|
||||
{/* Save button — appears when in editing mode with unsaved changes */}
|
||||
{onSave && hasUnsavedChanges && (
|
||||
<ToolbarGroup>
|
||||
<ToolbarButton
|
||||
tooltip={isSaving ? 'Saving...' : 'Save (⌘+S)'}
|
||||
onClick={onSave}
|
||||
disabled={isSaving}
|
||||
className="text-white"
|
||||
>
|
||||
{isSaving ? (
|
||||
<Spinner size="xs" />
|
||||
) : (
|
||||
<SaveIcon />
|
||||
)}
|
||||
</ToolbarButton>
|
||||
</ToolbarGroup>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className="grow" />
|
||||
|
||||
{/* Save button — only in edit mode with unsaved changes */}
|
||||
{!readOnly && onSave && hasUnsavedChanges && (
|
||||
<ToolbarGroup>
|
||||
<ToolbarButton
|
||||
tooltip={isSaving ? 'Saving...' : 'Save (⌘+S)'}
|
||||
onClick={onSave}
|
||||
disabled={isSaving}
|
||||
className="bg-primary text-primary-foreground hover:bg-primary/90"
|
||||
>
|
||||
{isSaving ? (
|
||||
<Spinner size="xs" />
|
||||
) : (
|
||||
<SaveIcon />
|
||||
)}
|
||||
</ToolbarButton>
|
||||
</ToolbarGroup>
|
||||
)}
|
||||
|
||||
{/* Mode toggle */}
|
||||
{canToggleMode && (
|
||||
<ToolbarGroup>
|
||||
<ModeToolbarButton />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue