Merge pull request #233 from acoard/feat/close-on-esc

Close the profile password modal via 'Esc' key
This commit is contained in:
Mike Cao 2020-09-29 21:26:25 -07:00 committed by GitHub
commit ce2ca57aba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import TimezoneSetting from 'components/settings/TimezoneSetting';
import Dots from 'assets/ellipsis-h.svg';
import styles from './ProfileSettings.module.css';
import DateRangeSetting from './DateRangeSetting';
import useEscapeKey from 'hooks/useEscapeKey';
export default function ProfileSettings() {
const user = useSelector(state => state.user);
@ -22,6 +23,10 @@ export default function ProfileSettings() {
setMessage(<FormattedMessage id="message.save-success" defaultMessage="Saved successfully." />);
}
useEscapeKey(() => {
setChangePassword(false);
});
return (
<>
<PageHeader>