Skip to content

Commit

Permalink
Added view password icon
Browse files Browse the repository at this point in the history
  • Loading branch information
jzongker committed Sep 24, 2024
1 parent 15e0d1e commit c30e50d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@churchapps/apphelper": "0.2.43",
"@churchapps/apphelper": "0.2.44",
"@mui/icons-material": "^5.14.7",
"@mui/material": "^5.14.7",
"@types/react-cropper": "^1.3.2",
Expand Down
11 changes: 8 additions & 3 deletions src/profile/ProfilePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Grid, Icon, TextField, Checkbox, Typography, Button, FormControl, InputLabel, Select, MenuItem, SelectChangeEvent } from "@mui/material";
import { Grid, Icon, TextField, Checkbox, Typography, Button, FormControl, InputLabel, Select, MenuItem, SelectChangeEvent, InputAdornment, IconButton } from "@mui/material";
import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import { InputBox, ApiHelper, ErrorMessages, UserHelper, NotificationPreferenceInterface, Locale } from "@churchapps/apphelper"
Expand All @@ -12,6 +12,7 @@ export const ProfilePage = () => {
const [optedOut, setOptedOut] = useState<boolean>(false);
const [errors, setErrors] = useState([]);
const [pref, setPref] = useState<NotificationPreferenceInterface>({} as NotificationPreferenceInterface);
const [showPassword, setShowPassword] = useState(false);
const navigate = useNavigate();

const initData = () => {
Expand Down Expand Up @@ -130,8 +131,12 @@ export const ProfilePage = () => {
<TextField fullWidth name="lastName" label={Locale.label("person.lastName")} value={lastName} onChange={handleChange} />
</Grid>
<Grid item>
<TextField type="password" fullWidth name="password" label={Locale.label("profile.profilePage.passNew")} value={password} onChange={handleChange} />
<TextField type="password" fullWidth name="passwordVerify" label={Locale.label("profile.profilePage.passVer")} value={passwordVerify} onChange={handleChange} />
<TextField type={showPassword ? "text" : "password"} fullWidth name="password" label={Locale.label("profile.profilePage.passNew")} value={password} onChange={handleChange} InputProps={{
endAdornment: (<InputAdornment position="end"><IconButton aria-label="toggle password visibility" onClick={() => { setShowPassword(!showPassword) }}>{showPassword ? <Icon>visibility</Icon> : <Icon>visibility_off</Icon>}</IconButton></InputAdornment>)
}} />
<TextField type={showPassword ? "text" : "password"} fullWidth name="passwordVerify" label={Locale.label("profile.profilePage.passVer")} value={passwordVerify} onChange={handleChange} InputProps={{
endAdornment: (<InputAdornment position="end"><IconButton aria-label="toggle password visibility" onClick={() => { setShowPassword(!showPassword) }}>{showPassword ? <Icon>visibility</Icon> : <Icon>visibility_off</Icon>}</IconButton></InputAdornment>)
}} />
<Checkbox name="optedOut" checked={optedOut} onChange={handleChange} />
<label htmlFor="optedOut">{Locale.label("profile.profilePage.noDirect")}</label>
</Grid>
Expand Down

0 comments on commit c30e50d

Please sign in to comment.