root.tsx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { useEffect } from 'react'
  2. import { Alert } from 'react-bootstrap'
  3. import { useTranslation } from 'react-i18next'
  4. import getMeta from '../../../utils/meta'
  5. import EmailsSection from './emails-section'
  6. import AccountInfoSection from './account-info-section'
  7. import PasswordSection from './password-section'
  8. import LinkingSection from './linking-section'
  9. import MiscSection from './misc-section'
  10. import LeaveSection from './leave-section'
  11. import * as eventTracking from '../../../infrastructure/event-tracking'
  12. import { UserProvider } from '../../../shared/context/user-context'
  13. import { SSOProvider } from '../context/sso-context'
  14. function SettingsPageRoot() {
  15. const { t } = useTranslation()
  16. const ssoError = getMeta('ol-ssoError') as string
  17. useEffect(() => {
  18. eventTracking.sendMB('settings-view')
  19. }, [])
  20. return (
  21. <UserProvider>
  22. <div className="container">
  23. <div className="row">
  24. <div className="col-md-12 col-lg-10 col-lg-offset-1">
  25. {ssoError ? (
  26. <Alert bsStyle="danger">
  27. {t('sso_link_error')}: {t(ssoError)}
  28. </Alert>
  29. ) : null}
  30. <div className="card">
  31. <div className="page-header">
  32. <h1>{t('account_settings')}</h1>
  33. </div>
  34. <div>
  35. <EmailsSection />
  36. <div className="row">
  37. <div className="col-md-5">
  38. <AccountInfoSection />
  39. </div>
  40. <div className="col-md-5 col-md-offset-1">
  41. <PasswordSection />
  42. </div>
  43. </div>
  44. <hr />
  45. <SSOProvider>
  46. <LinkingSection />
  47. </SSOProvider>
  48. <MiscSection />
  49. <hr />
  50. <LeaveSection />
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </UserProvider>
  57. )
  58. }
  59. export default SettingsPageRoot