mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Added author name as an additional check for official themes (#21665)
ref DES-982 - we're hiding font-related theme settings from official themes to make room for the new custom font settings - this adds author name as an additional check on top of the existing ones (theme name and corresponding setting keys)
This commit is contained in:
parent
68d8262fab
commit
1f501c1e58
2 changed files with 5 additions and 1 deletions
|
@ -10,6 +10,9 @@ export type Theme = {
|
|||
name?: string;
|
||||
description?: string;
|
||||
version?: string;
|
||||
author?: {
|
||||
name?: string;
|
||||
}
|
||||
};
|
||||
templates?: string[];
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ const ThemeSettings: React.FC<ThemeSettingsProps> = ({sections, updateSetting})
|
|||
const {data: themesData} = useBrowseThemes();
|
||||
const activeTheme = themesData?.themes.find((theme: Theme) => theme.active);
|
||||
const activeThemeName = activeTheme?.package.name?.toLowerCase() || '';
|
||||
const activeThemeAuthor = activeTheme?.package.author?.name || '';
|
||||
const hasCustomFonts = useFeatureFlag('customFonts');
|
||||
|
||||
return (
|
||||
|
@ -69,7 +70,7 @@ const ThemeSettings: React.FC<ThemeSettingsProps> = ({sections, updateSetting})
|
|||
// should be removed once we remove the settings from the themes in 6.0
|
||||
if (hasCustomFonts) {
|
||||
const hidingSettings = themeSettingsMap[activeThemeName];
|
||||
if (hidingSettings && hidingSettings.includes(setting.key)) {
|
||||
if (hidingSettings && hidingSettings.includes(setting.key) && activeThemeAuthor === 'Ghost Foundation') {
|
||||
spaceClass += ' hidden';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue