PersonalSettings.jsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. import CustomNavigation from '../CustomNavigation';
  5. import UserSettings from './UserSettings';
  6. import PasswordSettings from './PasswordSettings';
  7. import ExternalAccountLinkedMe from './ExternalAccountLinkedMe';
  8. import ApiSettings from './ApiSettings';
  9. import UserIcon from '../Icons/UserIcon';
  10. import ShareAltIcon from '../Icons/ShareAltIcon';
  11. import LockIcon from '../Icons/LooockIcon';
  12. import PaperPlaneIcon from '../Icons/PaperPlaneIcon';
  13. class PersonalSettings extends React.Component {
  14. render() {
  15. const { t } = this.props;
  16. const navTabMapping = {
  17. user_infomation: {
  18. Icon: UserIcon,
  19. Content: UserSettings,
  20. i18n: t('User Information'),
  21. index: 0,
  22. },
  23. external_accounts: {
  24. Icon: ShareAltIcon,
  25. Content: ExternalAccountLinkedMe,
  26. i18n: t('admin:user_management.external_accounts'),
  27. index: 1,
  28. },
  29. password_settings: {
  30. Icon: LockIcon,
  31. Content: PasswordSettings,
  32. i18n: t('Password Settings'),
  33. index: 2,
  34. },
  35. api_settings: {
  36. Icon: PaperPlaneIcon,
  37. Content: ApiSettings,
  38. i18n: t('API Settings'),
  39. index: 3,
  40. },
  41. };
  42. return (
  43. <>
  44. <header className="py-3">
  45. <div className="container-fluid">
  46. <h1 className="title">{ t('User Settings') }</h1>
  47. </div>
  48. </header>
  49. <div id="main" className="main">
  50. <div id="content-main" className="content-main container-lg">
  51. <CustomNavigation navTabMapping={navTabMapping} tabContentClasses={['px-0']} />
  52. </div>
  53. </div>
  54. </>
  55. );
  56. }
  57. }
  58. PersonalSettings.propTypes = {
  59. t: PropTypes.func.isRequired, // i18next
  60. };
  61. export default withTranslation()(PersonalSettings);