Skip to content

Commit

Permalink
Add ability to show password house
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Oct 23, 2023
1 parent fd83f7d commit 41c1241
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions front/src/components/house/EditHouse.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ const EditHouse = ({ children, ...props }) => (
onInput={props.updateHouseAlarmCode}
/>
</Localizer>
<span class="input-icon-addon cursor-pointer" onClick={props.togglePassword}>
<span class="input-icon-addon cursor-pointer" onClick={props.toggleAlarmCodePassword}>
<i
class={cx('fe', {
'fe-eye': !props.showPassword,
'fe-eye-off': props.showPassword
'fe-eye': !props.showAlarmCode,
'fe-eye-off': props.showAlarmCode
})}
/>
</span>
Expand Down
12 changes: 10 additions & 2 deletions front/src/components/house/EditHouseComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,21 @@ class EditHouseComponent extends Component {
this.addRoom();
}
};
toggleAlarmCodePassword = () => {
this.setState(prevState => {
return { ...prevState, showAlarmCode: !this.state.showAlarmCode };
});
};
constructor(props) {
super(props);
this.props = props;
this.state = {
newRoomName: ''
newRoomName: '',
showAlarmCode: false
};
}

render(props, { newRoomName, wantToDeleteHouse, loading }) {
render(props, { newRoomName, wantToDeleteHouse, loading, showAlarmCode }) {
return (
<EditHouse
{...props}
Expand All @@ -90,6 +96,8 @@ class EditHouseComponent extends Component {
deleteHouse={this.deleteHouse}
confirmDeleteHouse={this.confirmDeleteHouse}
cancelDeleteHouse={this.cancelDeleteHouse}
toggleAlarmCodePassword={this.toggleAlarmCodePassword}
showAlarmCode={showAlarmCode}
loading={loading}
/>
);
Expand Down

0 comments on commit 41c1241

Please sign in to comment.