mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Toast notifications.
This commit is contained in:
parent
2837251db7
commit
aec012fb79
6 changed files with 69 additions and 1 deletions
|
|
@ -5,12 +5,19 @@ import Button from 'components/common/Button';
|
|||
import ChangePasswordForm from '../forms/ChangePasswordForm';
|
||||
import Modal from 'components/common/Modal';
|
||||
import Dots from 'assets/ellipsis-h.svg';
|
||||
import Toast from '../common/Toast';
|
||||
|
||||
export default function ProfileSettings() {
|
||||
const user = useSelector(state => state.user);
|
||||
const [changePassword, setChangePassword] = useState(false);
|
||||
const [message, setMessage] = useState();
|
||||
const { user_id } = user;
|
||||
|
||||
function handleSave() {
|
||||
setChangePassword(false);
|
||||
setMessage('Saved successfully.');
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHeader>
|
||||
|
|
@ -27,11 +34,12 @@ export default function ProfileSettings() {
|
|||
<Modal title="Change password">
|
||||
<ChangePasswordForm
|
||||
values={{ user_id }}
|
||||
onSave={() => setChangePassword(false)}
|
||||
onSave={handleSave}
|
||||
onClose={() => setChangePassword(false)}
|
||||
/>
|
||||
</Modal>
|
||||
)}
|
||||
{message && <Toast message={message} onClose={() => setMessage(null)} />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue