0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-10 02:42:43 +00:00

Update Theme Selector display

For User/Brew Themes, display the first author instead of Brew/V3 in the first column.
This commit is contained in:
David Bolack
2024-05-13 22:24:41 -05:00
parent 8c5f4e0605
commit 66e39d9c65
2 changed files with 5 additions and 3 deletions

View File

@@ -202,7 +202,7 @@ const MetadataEditor = createClass({
const preview = theme?.thumbnail ? theme.thumbnail : `/themes/${theme.renderer}/${theme.path}/dropdownPreview.png`; const preview = theme?.thumbnail ? theme.thumbnail : `/themes/${theme.renderer}/${theme.path}/dropdownPreview.png`;
const texture = theme?.thumbnail ? theme.thumbnail : `/themes/${theme.renderer}/${theme.path}/dropdownTexture.png`; const texture = theme?.thumbnail ? theme.thumbnail : `/themes/${theme.renderer}/${theme.path}/dropdownTexture.png`;
return <div className='item' key={`${renderer}_${theme.name}`} onClick={()=>this.handleTheme(theme, renderer)} title={''}> return <div className='item' key={`${renderer}_${theme.name}`} onClick={()=>this.handleTheme(theme, renderer)} title={''}>
{`${renderer} : ${theme.name}`} {`${theme?.author ? theme.author : renderer} : ${theme.name}`}
<div className='texture-container'> <div className='texture-container'>
<img src={`${texture}`}/> <img src={`${texture}`}/>
</div> </div>
@@ -230,7 +230,7 @@ const MetadataEditor = createClass({
dropdown = dropdown =
<Nav.dropdown className='value' trigger='click'> <Nav.dropdown className='value' trigger='click'>
<div> <div>
{`${_.upperFirst(currentThemePath)} : ${currentTheme.name}`} <i className='fas fa-caret-down'></i> {`${currentTheme?.author ? currentTheme.author : _.upperFirst(currentThemePath)} : ${currentTheme.name}`} <i className='fas fa-caret-down'></i>
</div> </div>
{/*listThemes('Legacy')*/} {/*listThemes('Legacy')*/}
{listThemes('V3')} {listThemes('V3')}

View File

@@ -75,7 +75,8 @@ const api = {
'editId', 'editId',
'thumbnail', 'thumbnail',
'textBin', 'textBin',
'text' 'text',
'authors'
]; ];
const userThemes = { const userThemes = {
@@ -93,6 +94,7 @@ const api = {
renderer : 'V3', renderer : 'V3',
baseTheme : '', baseTheme : '',
baseSnippets : false, baseSnippets : false,
author : brew.authors[0],
path : `#${brew.editId}`, path : `#${brew.editId}`,
thumbnail : brew.thumbnail.length > 0 ? brew.thumbnail : '/assets/naturalCritLogoWhite.svg' thumbnail : brew.thumbnail.length > 0 ? brew.thumbnail : '/assets/naturalCritLogoWhite.svg'
}; };