PersonalSettings.jsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. <CustomNavigation navTabMapping={navTabMapping} />
  44. );
  45. }
  46. }
  47. PersonalSettings.propTypes = {
  48. t: PropTypes.func.isRequired, // i18next
  49. };
  50. export default withTranslation()(PersonalSettings);