feat(UI): improve filesize input and use it in settings (#721)
* Improve file size input component layout * Fix filesize input value not getting set * Allow arbitrary props on filesize input * Update config variables to support filesize type and integrate FileSizeInput component * Update i18n entries * WARNING GUESSES: Update translation descriptions for max size and chunk size in multiple languages * Fix config service not being aware of filesize type * Fix backend config service not being aware of filesize type * Move FileSizeInput component to core
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
} from "@mantine/core";
|
||||
import { useForm } from "@mantine/form";
|
||||
import { AdminConfig, UpdateConfig } from "../../../types/config.type";
|
||||
import FileSizeInput from "../../core/FileSizeInput";
|
||||
|
||||
const AdminConfigInput = ({
|
||||
configVariable,
|
||||
@@ -71,6 +72,15 @@ const AdminConfigInput = ({
|
||||
{...form.getInputProps("numberValue")}
|
||||
placeholder={configVariable.defaultValue}
|
||||
onChange={(number) => onValueChange(configVariable, number)}
|
||||
w={201}
|
||||
/>
|
||||
)}
|
||||
{configVariable.type == "filesize" && (
|
||||
<FileSizeInput
|
||||
{...form.getInputProps("numberValue")}
|
||||
value={parseInt(configVariable.value ?? configVariable.defaultValue)}
|
||||
onChange={(bytes) => onValueChange(configVariable, bytes)}
|
||||
w={201}
|
||||
/>
|
||||
)}
|
||||
{configVariable.type == "boolean" && (
|
||||
|
||||
Reference in New Issue
Block a user