feat: introduce login page
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { Controller, Control, FieldValues } from 'react-hook-form';
|
||||
import { Controller, useFormContext } from 'react-hook-form';
|
||||
import MuiTextField, { TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';
|
||||
import IconButton from '@mui/material/IconButton';
|
||||
import InputAdornment from '@mui/material/InputAdornment';
|
||||
@@ -8,7 +8,6 @@ import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
||||
import copyInputValue from 'helpers/copyInputValue';
|
||||
|
||||
type TextFieldProps = {
|
||||
control?: Control<FieldValues>;
|
||||
shouldUnregister?: boolean;
|
||||
name: string;
|
||||
clickToCopy?: boolean;
|
||||
@@ -17,21 +16,21 @@ type TextFieldProps = {
|
||||
|
||||
const createCopyAdornment = (ref: React.RefObject<HTMLInputElement | null>): React.ReactElement => {
|
||||
return (
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
onClick={() => copyInputValue(ref.current as HTMLInputElement)}
|
||||
edge="end"
|
||||
>
|
||||
<ContentCopyIcon color="primary" />
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
);
|
||||
<InputAdornment position="end">
|
||||
<IconButton
|
||||
onClick={() => copyInputValue(ref.current as HTMLInputElement)}
|
||||
edge="end"
|
||||
>
|
||||
<ContentCopyIcon color="primary" />
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
);
|
||||
}
|
||||
|
||||
export default function TextField(props: TextFieldProps): React.ReactElement {
|
||||
const { control } = useFormContext();
|
||||
const inputRef = React.useRef<HTMLInputElement | null>(null);
|
||||
const {
|
||||
control,
|
||||
required,
|
||||
name,
|
||||
defaultValue,
|
||||
|
Reference in New Issue
Block a user