mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-06 16:32:40 +00:00
Change combobox default text
This commit is contained in:
@@ -16,8 +16,6 @@ const SYSTEMS = ['5e', '4e', '3.5e', 'Pathfinder'];
|
|||||||
|
|
||||||
const homebreweryThumbnail = require('../../thumbnail.png');
|
const homebreweryThumbnail = require('../../thumbnail.png');
|
||||||
|
|
||||||
let mergedThemes;
|
|
||||||
|
|
||||||
const callIfExists = (val, fn, ...args)=>{
|
const callIfExists = (val, fn, ...args)=>{
|
||||||
if(val[fn]) {
|
if(val[fn]) {
|
||||||
val[fn](...args);
|
val[fn](...args);
|
||||||
@@ -223,12 +221,11 @@ const MetadataEditor = createClass({
|
|||||||
<img src={preview}/>
|
<img src={preview}/>
|
||||||
</div>
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
});
|
}).filter(Boolean);
|
||||||
};
|
};
|
||||||
|
|
||||||
const currentRenderer = this.props.metadata.renderer;
|
const currentRenderer = this.props.metadata.renderer;
|
||||||
const currentTheme = mergedThemes[`${_.upperFirst(this.props.metadata.renderer)}`][this.props.metadata.theme]
|
const currentThemeDisplay = this.props.themeBundle?.name ? `${this.props.themeBundle.author ?? currentRenderer} : ${this.props.themeBundle.name}` : 'No Theme Selected';
|
||||||
?? { name: `${this.props.themeBundle?.name || ''}`, author: `${this.props.themeBundle?.author || ''}` };
|
|
||||||
let dropdown;
|
let dropdown;
|
||||||
|
|
||||||
if(currentRenderer == 'legacy') {
|
if(currentRenderer == 'legacy') {
|
||||||
@@ -241,8 +238,8 @@ const MetadataEditor = createClass({
|
|||||||
<div className='value'>
|
<div className='value'>
|
||||||
<Combobox trigger='click'
|
<Combobox trigger='click'
|
||||||
className='themes-dropdown'
|
className='themes-dropdown'
|
||||||
default={`${currentTheme.author ?? _.upperFirst(currentRenderer)} : ${currentTheme.name}`}
|
default={currentThemeDisplay}
|
||||||
placeholder='Enter the Share URL or ID of any brew with the meta:theme tag'
|
placeholder='Select from below, or enter the Share URL or ID of a brew with the meta:theme tag'
|
||||||
onSelect={(value)=>this.handleTheme(value)}
|
onSelect={(value)=>this.handleTheme(value)}
|
||||||
onEntry={(e)=>{
|
onEntry={(e)=>{
|
||||||
e.target.setCustomValidity(''); //Clear the validation popup while typing
|
e.target.setCustomValidity(''); //Clear the validation popup while typing
|
||||||
|
|||||||
Reference in New Issue
Block a user