diff --git a/src/context/intermediate/popovers/CreateBot.tsx b/src/context/intermediate/popovers/CreateBot.tsx index 1f63940b..6010ba4f 100644 --- a/src/context/intermediate/popovers/CreateBot.tsx +++ b/src/context/intermediate/popovers/CreateBot.tsx @@ -1,6 +1,7 @@ import { SubmitHandler, useForm } from "react-hook-form"; import { Bot } from "revolt-api/types/Bots"; +import { Text } from "preact-i18n"; import { useContext, useState } from "preact/hooks"; import Modal from "../../../components/ui/Modal"; @@ -45,12 +46,12 @@ export function CreateBotModal({ onClose, onCreate }: Props) { contrast: true, accent: true, onClick: handleSubmit(onSubmit), - children: "Create", + children: , }, { plain: true, onClick: onClose, - children: "Cancel", + children: , }, ]}> {/* Preact / React typing incompatabilities */} diff --git a/src/pages/login/FormField.tsx b/src/pages/login/FormField.tsx index 719346c7..9f8b9131 100644 --- a/src/pages/login/FormField.tsx +++ b/src/pages/login/FormField.tsx @@ -67,7 +67,16 @@ export default function FormField({ }, } : type === "username" - ? { required: "RequiredField" } + ? { + validate: (value: string) => + value.length === 0 + ? "RequiredField" + : value.length < 2 + ? "TooShort" + : value.length > 32 + ? "TooLong" + : undefined, + } : { required: "RequiredField" }, )} />