2022-04-22 09:49:26 -04:00
|
|
|
import { useEffect } from 'react'
|
|
|
|
import { Alert } from 'react-bootstrap'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import getMeta from '../../../utils/meta'
|
|
|
|
import EmailsSection from './emails-section'
|
|
|
|
import AccountInfoSection from './account-info-section'
|
|
|
|
import PasswordSection from './password-section'
|
2022-04-25 07:04:44 -04:00
|
|
|
import LinkingSection from './linking-section'
|
2022-04-22 09:49:32 -04:00
|
|
|
import MiscSection from './misc-section'
|
2022-04-22 09:49:26 -04:00
|
|
|
import LeaveSection from './leave-section'
|
|
|
|
import * as eventTracking from '../../../infrastructure/event-tracking'
|
|
|
|
import { UserProvider } from '../../../shared/context/user-context'
|
2022-04-25 07:04:44 -04:00
|
|
|
import { SSOProvider } from '../context/sso-context'
|
2022-04-22 09:49:26 -04:00
|
|
|
|
|
|
|
function SettingsPageRoot() {
|
|
|
|
const { t } = useTranslation()
|
|
|
|
const ssoError = getMeta('ol-ssoError') as string
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
eventTracking.sendMB('settings-view')
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
return (
|
|
|
|
<UserProvider>
|
|
|
|
<div className="container">
|
|
|
|
<div className="row">
|
|
|
|
<div className="col-md-12 col-lg-10 col-lg-offset-1">
|
|
|
|
{ssoError ? (
|
|
|
|
<Alert bsStyle="danger">
|
|
|
|
{t('sso_link_error')}: {t(ssoError)}
|
|
|
|
</Alert>
|
|
|
|
) : null}
|
|
|
|
<div className="card">
|
|
|
|
<div className="page-header">
|
|
|
|
<h1>{t('account_settings')}</h1>
|
|
|
|
</div>
|
2022-04-25 07:04:44 -04:00
|
|
|
<div>
|
2022-04-22 09:49:26 -04:00
|
|
|
<EmailsSection />
|
|
|
|
<div className="row">
|
|
|
|
<div className="col-md-5">
|
|
|
|
<AccountInfoSection />
|
|
|
|
</div>
|
|
|
|
<div className="col-md-5 col-md-offset-1">
|
|
|
|
<PasswordSection />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr />
|
2022-04-25 07:04:44 -04:00
|
|
|
<SSOProvider>
|
|
|
|
<LinkingSection />
|
|
|
|
</SSOProvider>
|
2022-04-22 09:49:32 -04:00
|
|
|
<MiscSection />
|
|
|
|
<hr />
|
2022-04-22 09:49:26 -04:00
|
|
|
<LeaveSection />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</UserProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingsPageRoot
|