From a562cc7c7fa02a9bb4105c1b3b859c731bdfa9d0 Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Tue, 17 Oct 2023 10:15:58 +0700 Subject: [PATCH] Fixed default theme button in theme settings (#18656) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - the default theme (currently Source) showed Activate despite being active already, which may lead to confusion. - This fix checks whether it's already to more accurately display the wording of the button --- ### 🤖 Generated by Copilot at 4fd443c Fix theme preview button label for default theme. Hide the activate button for the default theme if it is already active in `ThemePreview.tsx`. --- .../src/components/settings/site/theme/ThemePreview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/admin-x-settings/src/components/settings/site/theme/ThemePreview.tsx b/apps/admin-x-settings/src/components/settings/site/theme/ThemePreview.tsx index 0a0244345b..017d0e255b 100644 --- a/apps/admin-x-settings/src/components/settings/site/theme/ThemePreview.tsx +++ b/apps/admin-x-settings/src/components/settings/site/theme/ThemePreview.tsx @@ -72,7 +72,7 @@ const ThemePreview: React.FC<{ if (isInstalling) { installButtonLabel = 'Installing...'; - } else if (selectedTheme.ref === 'default') { + } else if (selectedTheme.ref === 'default' && !installedTheme?.active) { installButtonLabel = `Activate ${selectedTheme.name}`; } else if (installedTheme) { installButtonLabel = `Update ${selectedTheme.name}`;