refactor: enforce semantic values and numeric lint rules
This commit is contained in:
@@ -25,6 +25,8 @@ import classes from "./BankForms.module.css";
|
||||
import { BankOperationIcon } from "./BankOperationIcon";
|
||||
import { useBankFormFocus } from "./useBankFormFocus";
|
||||
|
||||
const MAX_CATEGORY_NAME_LENGTH = 80;
|
||||
|
||||
type CategoryManagerProps = {
|
||||
onClose: () => void;
|
||||
onCreated?: (id: string) => void;
|
||||
@@ -67,7 +69,8 @@ const CategoryManager: FC<CategoryManagerProps> = (props) => {
|
||||
.string()
|
||||
.trim()
|
||||
.refine(
|
||||
(value) => value.length > 0 && value.length <= 80,
|
||||
(value) =>
|
||||
value.length > 0 && value.length <= MAX_CATEGORY_NAME_LENGTH,
|
||||
validationMessage("bank.validation.category"),
|
||||
)
|
||||
.refine(
|
||||
|
||||
Reference in New Issue
Block a user