mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
e63c5565a6
Delay Settings Page Content Until Translations Are Ready GitOrigin-RevId: 0537367f672bd2e88c95248d15c5638887ff3aee
72 lines
2 KiB
TypeScript
72 lines
2 KiB
TypeScript
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'
|
|
import LinkingSection from './linking-section'
|
|
import MiscSection from './misc-section'
|
|
import LeaveSection from './leave-section'
|
|
import * as eventTracking from '../../../infrastructure/event-tracking'
|
|
import { UserProvider } from '../../../shared/context/user-context'
|
|
import { SSOProvider } from '../context/sso-context'
|
|
import useWaitForI18n from '../../../shared/hooks/use-wait-for-i18n'
|
|
|
|
function SettingsPageRoot() {
|
|
const { isReady } = useWaitForI18n()
|
|
|
|
useEffect(() => {
|
|
eventTracking.sendMB('settings-view')
|
|
}, [])
|
|
|
|
return (
|
|
<div className="container">
|
|
<div className="row">
|
|
<div className="col-md-12 col-lg-10 col-lg-offset-1">
|
|
{isReady ? <SettingsPageContent /> : null}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
function SettingsPageContent() {
|
|
const { t } = useTranslation()
|
|
const ssoError = getMeta('ol-ssoError') as string
|
|
|
|
return (
|
|
<UserProvider>
|
|
{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>
|
|
<div>
|
|
<EmailsSection />
|
|
<div className="row">
|
|
<div className="col-md-5">
|
|
<AccountInfoSection />
|
|
</div>
|
|
<div className="col-md-5 col-md-offset-1">
|
|
<PasswordSection />
|
|
</div>
|
|
</div>
|
|
<hr />
|
|
<SSOProvider>
|
|
<LinkingSection />
|
|
</SSOProvider>
|
|
<MiscSection />
|
|
<hr />
|
|
<LeaveSection />
|
|
</div>
|
|
</div>
|
|
</UserProvider>
|
|
)
|
|
}
|
|
|
|
export default SettingsPageRoot
|