[enhancement] Add a button size setting (#486)

* Add a button size setting

* Reduce setting size and add px suffix

* Looks like I don't need || inside of control-settings

* Update translation

* Bump settings version to 7
This commit is contained in:
Benjamin 2024-02-03 15:22:26 -06:00 committed by GitHub
parent 933573b57f
commit 86a93866d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 46 additions and 12 deletions

View file

@ -36,6 +36,35 @@ export const ControlSettings = () => {
const { setSettings } = useSettingsStoreActions();
const controlOptions = [
{
control: (
<NumberInput
defaultValue={settings.buttonSize}
max={30}
min={15}
rightSection="px"
width={75}
onBlur={(e) => {
if (!e) return;
const newVal = e.currentTarget.value
? Math.min(Math.max(Number(e.currentTarget.value), 15), 30)
: settings.buttonSize;
setSettings({
general: {
...settings,
buttonSize: newVal,
},
});
}}
/>
),
description: t('setting.buttonSize', {
context: 'description',
postProcess: 'sentenceCase',
}),
isHidden: false,
title: t('setting.buttonSize', { postProcess: 'sentenceCase' }),
},
{
control: (
<Switch