diff options
| author | 2019-12-09 02:21:08 +0700 | |
|---|---|---|
| committer | 2019-12-09 02:21:08 +0700 | |
| commit | 05da99e5e3f1aefdb1441e4a2aaf62d3518de3f4 (patch) | |
| tree | ad0b39a38c1e082ce79108fb07658cebb6bf47aa /source/options.tsx | |
| parent | f6d9f445ea04ccd1e3f0fbe955d1a55da316b40d (diff) | |
| download | refined-github-05da99e5e3f1aefdb1441e4a2aaf62d3518de3f4.tar.gz refined-github-05da99e5e3f1aefdb1441e4a2aaf62d3518de3f4.tar.zst refined-github-05da99e5e3f1aefdb1441e4a2aaf62d3518de3f4.zip | |
Meta: Minor improvements thanks to new JS operators (#2600)
Diffstat (limited to 'source/options.tsx')
| -rw-r--r-- | source/options.tsx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/options.tsx b/source/options.tsx index 4002f62a..a18592a2 100644 --- a/source/options.tsx +++ b/source/options.tsx @@ -28,10 +28,6 @@ function buildFeatureCheckbox({name, description, screenshot, disabled}: Feature // `undefined` disconnects it from the options const key = disabled ? undefined : `feature:${name}`; - const disabledText = disabled ? - <small>{parseDescription(`(Disabled because of ${disabled}) `)}</small> : - false; - return ( <div className={`feature feature--${disabled ? 'disabled' : 'enabled'}`} data-text={`${name} ${description}`.toLowerCase()}> <input type="checkbox" name={key} id={name} disabled={Boolean(disabled)} /> @@ -39,14 +35,21 @@ function buildFeatureCheckbox({name, description, screenshot, disabled}: Feature <label for={name}> <span className="feature-name">{name}</span> {' '} - {disabledText} + {disabled && <small>{parseDescription(`(Disabled because of ${disabled}) `)}</small>} <a href={`https://github.com/sindresorhus/refined-github/blob/master/source/features/${name}.tsx`}> source </a> - {screenshot ? <>, <a href={screenshot}>screenshot</a></> : ''} + {screenshot && <>, <a href={screenshot}>screenshot</a></>} <br/> <p className="description">{parseDescription(description)}</p> </label> + { + name === 'minimize-user-comments' && + <div className="extended-options"> + <p>User list:</p> + <textarea name="minimizedUsers" rows={2} spellCheck="false"/> + </div> + } </div> </div> ); @@ -104,9 +107,6 @@ async function init(): Promise<void> { select<HTMLAnchorElement>('#personal-token-link')!.host = dropdown.value; }); } - - // Move minimized users input field below the respective feature checkbox - select('[for="minimize-user-comments"]')!.after(select('.js-minimized-users-container')!); } init(); |
