root.tsx 1.9 KB

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