mirror of
https://github.com/gnmyt/LicenseAPI.git
synced 2026-01-10 10:11:47 +00:00
Create LoginFields component
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
import {IconButton, InputAdornment, TextField} from "@mui/material";
|
||||
import {Key, Person, Visibility, VisibilityOff} from "@mui/icons-material";
|
||||
import {useState} from "react";
|
||||
|
||||
export const LoginFields = ({username, setUsername, password, setPassword}) => {
|
||||
const [passwordShown, setPasswordShown] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<TextField label="Username" variant="outlined" sx={{width: "20rem"}} type="text"
|
||||
placeholder="Username" autoComplete="username" value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
InputProps={{startAdornment: <InputAdornment position="start"><Person/></InputAdornment>}}/>
|
||||
|
||||
<TextField label="Password" variant="outlined" sx={{width: "20rem"}} placeholder="Password"
|
||||
InputProps={{
|
||||
startAdornment: <InputAdornment position="start"><Key/></InputAdornment>,
|
||||
endAdornment: <InputAdornment position="end"
|
||||
onClick={() => setPasswordShown(!passwordShown)}>
|
||||
<IconButton>{passwordShown ? <VisibilityOff/> : <Visibility/>}</IconButton>
|
||||
</InputAdornment>
|
||||
}} type={passwordShown ? "text" : "password"} autoComplete="current-password"
|
||||
value={password} onChange={(e) => setPassword(e.target.value)}/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
export {LoginFields as default} from "./LoginFields.jsx";
|
||||
Reference in New Issue
Block a user