From 8dc26c18bc1088bbbf0b88c028f49b7e42a7bbc7 Mon Sep 17 00:00:00 2001 From: Saxon Fletcher Date: Wed, 22 Oct 2025 13:07:36 +1000 Subject: [PATCH] tab styling --- .../components/layouts/Tabs/SaveButton.tsx | 16 +++++----------- apps/studio/components/layouts/Tabs/Tabs.tsx | 12 ++++++------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/apps/studio/components/layouts/Tabs/SaveButton.tsx b/apps/studio/components/layouts/Tabs/SaveButton.tsx index 2b4970714b2..24cfefb31f8 100644 --- a/apps/studio/components/layouts/Tabs/SaveButton.tsx +++ b/apps/studio/components/layouts/Tabs/SaveButton.tsx @@ -11,13 +11,13 @@ import { useProfile } from 'lib/profile' import { createSqlSnippetSkeletonV2 } from 'components/interfaces/SQLEditor/SQLEditor.utils' import { untitledSnippetTitle } from 'components/interfaces/SQLEditor/SQLEditor.constants' import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2' -import { createTabId, useTabsStateSnapshot } from 'state/tabs' +import { useTabsStateSnapshot } from 'state/tabs' import uuidv4 from 'lib/uuid' -import { Button } from 'ui' +import { Button, cn } from 'ui' export const SaveButton = () => { const router = useRouter() - const { ref, id } = useParams() + const { ref } = useParams() const { profile } = useProfile() const { data: project } = useSelectedProjectQuery() const { isHipaaProjectDisallowed } = useOrgAiOptInLevel() @@ -48,13 +48,7 @@ export const SaveButton = () => { // Show save button if: // 1. SQL is different from snippet SQL (for existing snippets) // 2. OR no snippet exists and SQL is not empty (for new tabs) - const showSaveButton = snippetId - ? tabSql !== snippetSql - : tabSql.trim().length > 0 - - if (!showSaveButton) { - return null - } + const showSaveButton = snippetId ? tabSql !== snippetSql : tabSql.trim().length > 0 const handleSave = async () => { if (!ref || !profile || !project) return @@ -116,7 +110,7 @@ export const SaveButton = () => { icon={} loading={isSaving} onClick={handleSave} - className="ml-2" + className={cn('opacity-0', showSaveButton && 'opacity-100')} > Save diff --git a/apps/studio/components/layouts/Tabs/Tabs.tsx b/apps/studio/components/layouts/Tabs/Tabs.tsx index 9755ffa0d85..551a2bb0d89 100644 --- a/apps/studio/components/layouts/Tabs/Tabs.tsx +++ b/apps/studio/components/layouts/Tabs/Tabs.tsx @@ -216,7 +216,7 @@ export const EditorTabs = () => { {!hasNewTab && ( router.push( `/project/${router.query.ref}/${editor === 'table' ? 'editor' : 'sql'}/new?skip=true` @@ -235,12 +235,12 @@ export const EditorTabs = () => { )}
- {editor === 'sql' && ( -
- -
- )} + {editor === 'sql' && ( +
+ +
+ )}