-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add icons and login #1062
base: master
Are you sure you want to change the base?
add icons and login #1062
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import { | |
import makeStyles from '@mui/styles/makeStyles'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import ArrowBackIcon from '@mui/icons-material/ArrowBack'; | ||
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff'; | ||
import LoginLayout from './LoginLayout'; | ||
import { useTranslation } from '../common/components/LocalizationProvider'; | ||
import { snackBarDurationShortMs } from '../common/util/duration'; | ||
|
@@ -38,6 +39,11 @@ const RegisterPage = () => { | |
const [password, setPassword] = useState(''); | ||
const [snackbarOpen, setSnackbarOpen] = useState(false); | ||
|
||
const [showPassword, setShowPassword] = useState(false); | ||
const handleClickShowPassword = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ps from what it translates for me I understand that I must add the lines that you are showing me, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, you should remove them and inline the code. There's no point to have separate methods with just one line implementation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change is missing in RegisterPage.js type={showPassword ? 'text' : 'password'} |
||
setShowPassword(!showPassword); | ||
}; | ||
|
||
const handleSubmit = useCatch(async () => { | ||
const response = await fetch('/api/users', { | ||
method: 'POST', | ||
|
@@ -88,6 +94,13 @@ const RegisterPage = () => { | |
type="password" | ||
autoComplete="current-password" | ||
onChange={(event) => setPassword(event.target.value)} | ||
InputProps={{ | ||
endAdornment: ( | ||
<IconButton onClick={handleClickShowPassword}> | ||
<VisibilityOffIcon /> | ||
</IconButton> | ||
), | ||
}} | ||
/> | ||
<Button | ||
variant="contained" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please inline these callbacks.