mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-25 07:02:10 -05:00
Merge pull request #268 from brecert/fix-198
This commit is contained in:
commit
148c0edcbf
2 changed files with 38 additions and 32 deletions
|
@ -113,6 +113,7 @@ export function ModifyAccountModal({ onClose, field }: Props) {
|
|||
register={register}
|
||||
showOverline
|
||||
error={errors.new_password?.message}
|
||||
autoComplete="new-password"
|
||||
/>
|
||||
)}
|
||||
{field === "username" && (
|
||||
|
@ -129,6 +130,7 @@ export function ModifyAccountModal({ onClose, field }: Props) {
|
|||
register={register}
|
||||
showOverline
|
||||
error={errors.current_password?.message}
|
||||
autoComplete="current-password"
|
||||
/>
|
||||
{error && (
|
||||
<Overline type="error" error={error}>
|
||||
|
|
|
@ -5,8 +5,10 @@ import { Text, Localizer } from "preact-i18n";
|
|||
import InputBox from "../../components/ui/InputBox";
|
||||
import Overline from "../../components/ui/Overline";
|
||||
|
||||
interface Props {
|
||||
type: "email" | "username" | "password" | "invite" | "current_password";
|
||||
type FieldType = "email" | "username" | "password" | "invite" | "current_password";
|
||||
|
||||
type Props = Omit<JSX.HTMLAttributes<HTMLInputElement>, "children" | "as"> & {
|
||||
type: FieldType;
|
||||
showOverline?: boolean;
|
||||
register: UseFormMethods["register"];
|
||||
error?: string;
|
||||
|
@ -19,6 +21,7 @@ export default function FormField({
|
|||
showOverline,
|
||||
error,
|
||||
name,
|
||||
...props
|
||||
}: Props) {
|
||||
return (
|
||||
<>
|
||||
|
@ -79,6 +82,7 @@ export default function FormField({
|
|||
}
|
||||
: { required: "RequiredField" },
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
</Localizer>
|
||||
</>
|
||||
|
|
Loading…
Reference in a new issue