diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.jsx b/client/homebrew/editor/metadataEditor/metadataEditor.jsx
index d713c1cc9..d5c4387e9 100644
--- a/client/homebrew/editor/metadataEditor/metadataEditor.jsx
+++ b/client/homebrew/editor/metadataEditor/metadataEditor.jsx
@@ -2,13 +2,14 @@
import '../uiEditor.less';
import React, { useState } from 'react';
import _ from 'lodash';
-import request from '../../utils/request-middleware.js';
-import Combobox from '@components/combobox.jsx';
-import TagInput from '../tagInput/tagInput.jsx';
+import request from '../../utils/request-middleware.js';
import Themes from '@themes/themes.json';
import validations from './validations.js';
+import Combobox from '@components/combobox.jsx';
+import TagInput from '../tagInput/tagInput.jsx';
+
import homebreweryThumbnail from '../../thumbnail.png';
const callIfExists = (val, fn, ...args)=>{
@@ -19,32 +20,25 @@ const callIfExists = (val, fn, ...args)=>{
const MetadataEditor = ({
metadata = {
- editId : null,
shareId : null,
+ editId : null,
title : '',
description : '',
- thumbnail : '',
tags : [],
- published : false,
- authors : [],
- renderer : 'legacy',
- theme : '5ePHB',
lang : 'en',
+ renderer : 'legacy',
+ authors : [],
+ published : false,
+ thumbnail : '',
+ theme : '5ePHB',
},
-
onChange = ()=>{},
reportError = ()=>{},
- ...props
+ userThemes = {},
+ themeBundle = {}
})=>{
const [showThumbnail, setShowThumbnail] = useState(true);
- const toggleThumbnailDisplay = ()=>{
- setShowThumbnail(!showThumbnail);
- };
- const renderThumbnail = ()=>{
- if(!showThumbnail) return;
- return ;
- };
const handleFieldChange = (name, e)=>{
// load validation rules, and check input value against them
const inputRules = validations[name] ?? [];
@@ -90,13 +84,11 @@ const MetadataEditor = ({
const handleTheme = (theme)=>{
metadata.renderer = theme.renderer;
metadata.theme = theme.path;
-
onChange(metadata, 'theme');
};
const handleThemeWritein = (e)=>{
const shareId = e.target.value.split('/').pop(); //Extract just the ID if a URL was pasted in
metadata.theme = shareId;
-
onChange(metadata, 'theme');
};
const handleLanguage = (languageCode)=>{
@@ -141,18 +133,6 @@ const MetadataEditor = ({
;
}
};
- const renderDelete = ()=>{
- if(!metadata.editId) return;
-
- return