From 30fc8252a479ddf9e4320a7465d37f82310c118c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Mon, 19 Oct 2026 13:18:57 +0200 Subject: [PATCH] lint --- .../editor/metadataEditor/metadataEditor.jsx | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.jsx b/client/homebrew/editor/metadataEditor/metadataEditor.jsx index af357f4c0..adf25a8a2 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.jsx +++ b/client/homebrew/editor/metadataEditor/metadataEditor.jsx @@ -1,7 +1,6 @@ /* eslint-disable max-lines */ import '../uiEditor.less'; -import React, {useState, useEffect} from 'react'; -import createReactClass from 'create-react-class'; +import React, { useState } from 'react'; import _ from 'lodash'; import request from '../../utils/request-middleware.js'; import Combobox from '@components/combobox.jsx'; @@ -20,27 +19,26 @@ const callIfExists = (val, fn, ...args)=>{ const MetadataEditor = ({ metadata = { - editId: null, - shareId: null, - title: '', - description: '', - thumbnail: '', - tags: [], - published: false, - authors: [], - renderer: 'legacy', - theme: '5ePHB', - lang: 'en', + editId : null, + shareId : null, + title : '', + description : '', + thumbnail : '', + tags : [], + published : false, + authors : [], + renderer : 'legacy', + theme : '5ePHB', + lang : 'en', }, - onChange = () => {}, - reportError = () => {}, - -}, ...props) => { + onChange = ()=>{}, + reportError = ()=>{}, + +}, ...props)=>{ const [isOwner, setIsOwner] = useState(global.account?.username && global.account?.username === metadata?.authors[0]); const [showThumbnail, setShowThumbnail] = useState(true); - const toggleThumbnailDisplay = ()=>{ setShowThumbnail(!showThumbnail); }; @@ -96,7 +94,7 @@ const MetadataEditor = ({ onChange(metadata, 'theme'); }; - const handleThemeWritein = (e) =>{ + const handleThemeWritein = (e)=>{ const shareId = e.target.value.split('/').pop(); //Extract just the ID if a URL was pasted in metadata.theme = shareId; @@ -329,7 +327,6 @@ const MetadataEditor = ({ ; }; - return (

Properties Editor

@@ -341,7 +338,7 @@ const MetadataEditor = ({ id='title_field' className='value' defaultValue={metadata.title} - onChange={(e) => handleFieldChange('title', e)} + onChange={(e)=>handleFieldChange('title', e)} />
@@ -352,7 +349,7 @@ const MetadataEditor = ({ id='description_field' defaultValue={metadata.description} className='value' - onChange={(e) => handleFieldChange('description', e)} + onChange={(e)=>handleFieldChange('description', e)} />
@@ -363,7 +360,7 @@ const MetadataEditor = ({ defaultValue={metadata.thumbnail} placeholder='https://my.thumbnail.url' className='value' - onChange={(e) => handleFieldChange('thumbnail', e)} + onChange={(e)=>handleFieldChange('thumbnail', e)} />
@@ -409,13 +406,13 @@ const MetadataEditor = ({ id='combobox-invited-authors' label='invited authors' valuePatterns={/.+/} - validators={[(v) => !metadata.authors?.includes(v)]} + validators={[(v)=>!metadata.authors?.includes(v)]} placeholder='invite author' unique={true} tooltip={`Invited author usernames are case sensitive. After adding an invited author, send them the edit link. There, they can choose to accept or decline the invitation.`} values={metadata.invitedAuthors} - onChange={(e) => handleFieldChange('invitedAuthors', e)} + onChange={(e)=>handleFieldChange('invitedAuthors', e)} />