({value, onChange, suffix, onSuffixChange})
| 62 | const SUFFIXES = ['@shanghaitech.edu.cn', '@alumni.shanghaitech.edu.cn']; |
| 63 | |
| 64 | export function EmailSuffixField({value, onChange, suffix, onSuffixChange}) { |
| 65 | return ( |
| 66 | <> |
| 67 | <TextField |
| 68 | fullWidth |
| 69 | size='small' |
| 70 | variant='outlined' |
| 71 | label='上科大邮箱' |
| 72 | id='username' |
| 73 | name='username' |
| 74 | value={value} |
| 75 | onChange={onChange} |
| 76 | required |
| 77 | /> |
| 78 | <TextField |
| 79 | select |
| 80 | fullWidth |
| 81 | size='small' |
| 82 | variant='outlined' |
| 83 | label='邮箱后缀' |
| 84 | id='suffix' |
| 85 | name='suffix' |
| 86 | value={suffix} |
| 87 | onChange={onSuffixChange} |
| 88 | > |
| 89 | {SUFFIXES.map((s) => <MenuItem key={s} value={s}>{s}</MenuItem>)} |
| 90 | </TextField> |
| 91 | </> |
| 92 | ); |
| 93 | } |
| 94 | |
| 95 | export function PasswordField({label, ...props}) { |
| 96 | const [show, setShow] = useState(false); |
nothing calls this directly
no outgoing calls
no test coverage detected