From 2870caaae6716b427e21d2c4d9915afe3b046e01 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 28 Jul 2024 17:18:30 -0400 Subject: [PATCH] Clean up metadataEditor theme dropdown --- .../editor/metadataEditor/metadataEditor.jsx | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.jsx b/client/homebrew/editor/metadataEditor/metadataEditor.jsx index 473b2ab69..944c4d88a 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.jsx +++ b/client/homebrew/editor/metadataEditor/metadataEditor.jsx @@ -199,37 +199,34 @@ const MetadataEditor = createClass({ const preview = theme.thumbnail || `/themes/${theme.renderer}/${theme.path}/dropdownPreview.png`; const texture = theme.thumbnail || `/themes/${theme.renderer}/${theme.path}/dropdownTexture.png`; return
this.handleTheme(theme)} title={''}> -

{`${theme?.author ? theme.author : renderer} : ${theme.name}`}

+ {theme.author ?? renderer} : {theme.name}
- +
-
{`${theme.name}`} preview
- +
{theme.name} preview
+
; }); }; - const currentThemePath = this.props.metadata?.theme && Themes[_.upperFirst(this.props.metadata.renderer)]?.hasOwnProperty(this.props.metadata?.theme) ? this.props.metadata.renderer : 'Brew'; - const currentTheme = mergedThemes[`${_.upperFirst(currentThemePath)}`]?.hasOwnProperty(this.props.metadata.theme) ? mergedThemes[`${_.upperFirst(currentThemePath)}`][this.props.metadata.theme] : { name: `!!! THEME MISSING !!! ID=${this.props.metadata.theme.slice(1)}` }; + const currentRenderer = this.props.metadata.renderer; + const currentTheme = mergedThemes[`${_.upperFirst(this.props.metadata.renderer)}`][this.props.metadata.theme] + ?? { name: `!!! THEME MISSING !!! ID=${this.props.metadata.theme}` }; let dropdown; - if(this.props.metadata.renderer == 'legacy') { + if(currentRenderer == 'legacy') { dropdown = -
- {`Themes are not supported in the Legacy Renderer`} -
+
{`Themes are not supported in the Legacy Renderer`}
; } else { dropdown = -
- {`${currentTheme?.author ? currentTheme.author : _.upperFirst(currentThemePath)} : ${currentTheme.name}`} -
- {/*listThemes('Legacy')*/} - {listThemes('V3')} +
{currentTheme.author ?? _.upperFirst(currentRenderer)} : {currentTheme.name}
+ + {listThemes(currentRenderer)}
; }