PersonalSettings.jsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. class PersonalSettings extends React.Component {
  10. render() {
  11. const { t } = this.props;
  12. const UserIcon = () => {
  13. return <i className="icon-fw icon-user"></i>;
  14. };
  15. const shereAltIcon = () => {
  16. return <i className="icon-fw icon-share-alt"></i>;
  17. };
  18. const lockIcon = () => {
  19. return <i className="icon-fw icon-lock"></i>;
  20. };
  21. const paperPlaneIcon = () => {
  22. return <i className="icon-fw icon-paper-plane"></i>;
  23. };
  24. const navTabMapping = {
  25. user_infomation: {
  26. Icon: UserIcon,
  27. Content: UserSettings,
  28. i18n: t('User Information'),
  29. index: 0,
  30. },
  31. external_accounts: {
  32. Icon: shereAltIcon,
  33. Content: ExternalAccountLinkedMe,
  34. i18n: t('admin:user_management.external_accounts'),
  35. index: 1,
  36. },
  37. password_settings: {
  38. Icon: lockIcon,
  39. Content: PasswordSettings,
  40. i18n: t('Password Settings'),
  41. index: 2,
  42. },
  43. api_settings: {
  44. Icon: paperPlaneIcon,
  45. Content: ApiSettings,
  46. i18n: t('API Settings'),
  47. index: 3,
  48. },
  49. };
  50. return (
  51. <>
  52. <CustomNavigation navTabMapping={navTabMapping} />
  53. </>
  54. );
  55. }
  56. }
  57. PersonalSettings.propTypes = {
  58. t: PropTypes.func.isRequired, // i18next
  59. };
  60. export default withTranslation()(PersonalSettings);