root.tsx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 IntegrationLinkingSection from './integration-linking-section'
  9. import SSOLinkingSection from './sso-linking-section'
  10. import MiscSection from './misc-section'
  11. import LeaveSection from './leave-section'
  12. import * as eventTracking from '../../../infrastructure/event-tracking'
  13. import { UserProvider } from '../../../shared/context/user-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 className="account-settings">
  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. <IntegrationLinkingSection />
  46. <hr />
  47. <SSOLinkingSection />
  48. <hr />
  49. <MiscSection />
  50. <hr />
  51. <LeaveSection />
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </UserProvider>
  58. )
  59. }
  60. export default SettingsPageRoot