2024-03-11 08:28:55 -04:00
|
|
|
import SecuritySection from '@/features/settings/components/security-section'
|
2022-04-22 09:49:26 -04:00
|
|
|
import { useEffect } from 'react'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
import getMeta from '../../../utils/meta'
|
|
|
|
import EmailsSection from './emails-section'
|
|
|
|
import AccountInfoSection from './account-info-section'
|
2023-07-10 05:21:49 -04:00
|
|
|
import ManagedAccountAlert from './managed-account-alert'
|
2022-04-22 09:49:26 -04:00
|
|
|
import PasswordSection from './password-section'
|
2022-04-25 07:04:44 -04:00
|
|
|
import LinkingSection from './linking-section'
|
2022-04-26 11:35:35 -04:00
|
|
|
import BetaProgramSection from './beta-program-section'
|
2022-09-21 06:02:37 -04:00
|
|
|
import LabsProgramSection from './labs-program-section'
|
2022-04-26 11:35:35 -04:00
|
|
|
import SessionsSection from './sessions-section'
|
|
|
|
import NewsletterSection from './newsletter-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'
|
2023-12-07 09:29:45 -05:00
|
|
|
import { SplitTestProvider } from '@/shared/context/split-test-context'
|
2022-04-26 11:20:00 -04:00
|
|
|
import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n'
|
2022-05-11 05:19:27 -04:00
|
|
|
import useScrollToIdOnLoad from '../../../shared/hooks/use-scroll-to-id-on-load'
|
2022-05-18 09:46:26 -04:00
|
|
|
import { SSOAlert } from './emails/sso-alert'
|
2024-05-15 10:31:00 -04:00
|
|
|
import OLRow from '@/features/ui/components/ol/ol-row'
|
|
|
|
import OLCol from '@/features/ui/components/ol/ol-col'
|
|
|
|
import OLCard from '@/features/ui/components/ol/ol-card'
|
2022-04-22 09:49:26 -04:00
|
|
|
|
|
|
|
function SettingsPageRoot() {
|
2022-04-26 11:20:00 -04:00
|
|
|
const { isReady } = useWaitForI18n()
|
2022-05-11 05:19:27 -04:00
|
|
|
useScrollToIdOnLoad()
|
2022-04-22 09:49:26 -04:00
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
eventTracking.sendMB('settings-view')
|
|
|
|
}, [])
|
|
|
|
|
2022-04-26 11:20:00 -04:00
|
|
|
return (
|
|
|
|
<div className="container">
|
2024-05-15 10:31:00 -04:00
|
|
|
<OLRow>
|
2024-05-28 04:48:42 -04:00
|
|
|
<OLCol xl={{ span: 10, offset: 1 }}>
|
2022-04-26 11:20:00 -04:00
|
|
|
{isReady ? <SettingsPageContent /> : null}
|
2024-05-15 10:31:00 -04:00
|
|
|
</OLCol>
|
|
|
|
</OLRow>
|
2022-04-26 11:20:00 -04:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
function SettingsPageContent() {
|
|
|
|
const { t } = useTranslation()
|
2024-06-18 06:01:37 -04:00
|
|
|
const { isOverleaf, labsEnabled } = getMeta('ol-ExposedSettings')
|
2022-04-26 11:20:00 -04:00
|
|
|
|
2022-04-22 09:49:26 -04:00
|
|
|
return (
|
|
|
|
<UserProvider>
|
2024-05-15 10:31:00 -04:00
|
|
|
<OLCard>
|
2022-04-26 11:20:00 -04:00
|
|
|
<div className="page-header">
|
|
|
|
<h1>{t('account_settings')}</h1>
|
|
|
|
</div>
|
|
|
|
<div>
|
2023-07-10 05:21:49 -04:00
|
|
|
<ManagedAccountAlert />
|
2022-04-26 11:20:00 -04:00
|
|
|
<EmailsSection />
|
2022-05-18 09:46:26 -04:00
|
|
|
<SSOAlert />
|
2024-05-15 10:31:00 -04:00
|
|
|
<OLRow>
|
2024-05-28 04:48:42 -04:00
|
|
|
<OLCol lg={5}>
|
2022-04-26 11:20:00 -04:00
|
|
|
<AccountInfoSection />
|
2024-05-15 10:31:00 -04:00
|
|
|
</OLCol>
|
2024-05-28 04:48:42 -04:00
|
|
|
<OLCol lg={{ span: 5, offset: 1 }}>
|
2022-04-26 11:20:00 -04:00
|
|
|
<PasswordSection />
|
2024-05-15 10:31:00 -04:00
|
|
|
</OLCol>
|
|
|
|
</OLRow>
|
2022-04-26 11:20:00 -04:00
|
|
|
<hr />
|
2024-03-11 08:28:55 -04:00
|
|
|
<SecuritySection />
|
2023-12-07 09:29:45 -05:00
|
|
|
<SplitTestProvider>
|
|
|
|
<SSOProvider>
|
|
|
|
<LinkingSection />
|
|
|
|
</SSOProvider>
|
|
|
|
</SplitTestProvider>
|
2022-04-27 12:13:42 -04:00
|
|
|
{isOverleaf ? (
|
|
|
|
<>
|
|
|
|
<BetaProgramSection />
|
|
|
|
<hr />
|
|
|
|
</>
|
|
|
|
) : null}
|
2022-09-21 06:02:37 -04:00
|
|
|
{labsEnabled ? (
|
|
|
|
<>
|
|
|
|
<LabsProgramSection />
|
|
|
|
</>
|
|
|
|
) : null}
|
2022-04-26 11:35:35 -04:00
|
|
|
<SessionsSection />
|
|
|
|
{isOverleaf ? (
|
|
|
|
<>
|
2022-04-27 12:13:42 -04:00
|
|
|
<hr />
|
2022-04-26 11:35:35 -04:00
|
|
|
<NewsletterSection />
|
|
|
|
<hr />
|
|
|
|
<LeaveSection />
|
|
|
|
</>
|
|
|
|
) : null}
|
2022-04-22 09:49:26 -04:00
|
|
|
</div>
|
2024-05-15 10:31:00 -04:00
|
|
|
</OLCard>
|
2022-04-22 09:49:26 -04:00
|
|
|
</UserProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingsPageRoot
|