mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
[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:
parent
933573b57f
commit
86a93866d0
4 changed files with 46 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue