Skip to content

Commit

Permalink
feat: Work-in-progress Password peek-a-boo #314
Browse files Browse the repository at this point in the history
  • Loading branch information
olavea committed Jun 9, 2021
1 parent d29994f commit d23fc39
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/features/user/forms/PasswordForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ import React from "react"
import PropTypes from "prop-types"
import { TextField } from "@material-ui/core"

import IconButton from '@material-ui/core/IconButton';
import InputAdornment from '@material-ui/core/InputAdornment';
import Visibility from '@material-ui/icons/Visibility';
import VisibilityOff from '@material-ui/icons/VisibilityOff';


import { useUser } from "../useUser"

export const PasswordForm = ({ Component, title, onDone }) => {
Expand Down Expand Up @@ -44,7 +50,14 @@ export const PasswordForm = ({ Component, title, onDone }) => {
}

const disabled = isUpdating || isLoading
const [values, setValues] = React.useState({
password: '',
showPassword: false,
});

const handleChange = (event) => {}
const handleClickShowPassword = (event) => {}
const handleMouseDownPassword = (event) => {}
return (
<Component
onSubmit={handleSubmit}
Expand All @@ -63,6 +76,18 @@ export const PasswordForm = ({ Component, title, onDone }) => {
label="Current Password"
name="Current password"
autoComplete="current-password"
endAdornment={

This comment has been minimized.

Copy link
@raae

raae Jun 9, 2021

Owner

It needs to go on the TextField, not the element surrounding the fields.

<InputAdornment position="end">
<IconButton
aria-label="toggle pasSword visibility"
onClick={handleClickShowPassword}
onMouseDown={handleMouseDownPassword}
edge="end"
>
{values.showPassword ? <Visibility /> : <VisibilityOff />}
</IconButton>
</InputAdornment>
}
/>
<TextField
disabled={disabled}
Expand Down

0 comments on commit d23fc39

Please sign in to comment.