MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / PasswordField

Function PasswordField

src/Components/Auth/AuthShared.jsx:95–116  ·  view source on GitHub ↗
({label, ...props})

Source from the content-addressed store, hash-verified

93}
94
95export function PasswordField({label, ...props}) {
96 const [show, setShow] = useState(false);
97 return (
98 <TextField
99 fullWidth
100 size='small'
101 variant='outlined'
102 type={show ? 'text' : 'password'}
103 label={label}
104 {...props}
105 InputProps={{
106 endAdornment: (
107 <InputAdornment position='end'>
108 <IconButton size='small' edge='end' aria-label={show ? '隐藏密码' : '显示密码'} onClick={() => setShow((s) => !s)}>
109 {show ? <VisibilityOff fontSize='small'/> : <Visibility fontSize='small'/>}
110 </IconButton>
111 </InputAdornment>
112 ),
113 }}
114 />
115 );
116}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected