import React, { useState } from 'react'; import { FormattedMessage } from 'react-intl'; import PageHeader from 'components/layout/PageHeader'; import Button from 'components/common/Button'; import Modal from 'components/common/Modal'; import Toast from 'components/common/Toast'; import ChangePasswordForm from 'components/forms/ChangePasswordForm'; 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'; import useUser from 'hooks/useUser'; import LanguageSetting from './LanguageSetting'; import ThemeSetting from './ThemeSetting'; export default function ProfileSettings() { const { user } = useUser(); const [changePassword, setChangePassword] = useState(false); const [message, setMessage] = useState(null); function handleSave() { setChangePassword(false); setMessage(); } useEscapeKey(() => { setChangePassword(false); }); if (!user) { return null; } const { userId, username } = user; return ( <>
{username}
{changePassword && ( } > setChangePassword(false)} /> )} {message && setMessage(null)} />} ); }