|
|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
-import React from 'react';
|
|
|
+import React, { useMemo } from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
|
import { withTranslation } from 'react-i18next';
|
|
|
import CustomNavigation from '../CustomNavigation';
|
|
|
@@ -8,50 +8,45 @@ import PasswordSettings from './PasswordSettings';
|
|
|
import ExternalAccountLinkedMe from './ExternalAccountLinkedMe';
|
|
|
import ApiSettings from './ApiSettings';
|
|
|
|
|
|
-import UserIcon from '../Icons/UserIcon';
|
|
|
-import ShareAltIcon from '../Icons/ShareAltIcon';
|
|
|
-import LockIcon from '../Icons/LooockIcon';
|
|
|
-import PaperPlaneIcon from '../Icons/PaperPlaneIcon';
|
|
|
+const PersonalSettings = (props) => {
|
|
|
|
|
|
-class PersonalSettings extends React.Component {
|
|
|
+ const { t } = props;
|
|
|
|
|
|
- render() {
|
|
|
- const { t } = this.props;
|
|
|
-
|
|
|
- const navTabMapping = {
|
|
|
+ const navTabMapping = useMemo(() => {
|
|
|
+ return {
|
|
|
user_infomation: {
|
|
|
- Icon: UserIcon,
|
|
|
+ Icon: () => <i className="icon-fw icon-user"></i>,
|
|
|
Content: UserSettings,
|
|
|
i18n: t('User Information'),
|
|
|
index: 0,
|
|
|
},
|
|
|
external_accounts: {
|
|
|
- Icon: ShareAltIcon,
|
|
|
+ Icon: () => <i className="icon-fw icon-share-alt"></i>,
|
|
|
Content: ExternalAccountLinkedMe,
|
|
|
i18n: t('admin:user_management.external_accounts'),
|
|
|
index: 1,
|
|
|
},
|
|
|
password_settings: {
|
|
|
- Icon: LockIcon,
|
|
|
+ Icon: () => <i className="icon-fw icon-lock"></i>,
|
|
|
Content: PasswordSettings,
|
|
|
i18n: t('Password Settings'),
|
|
|
index: 2,
|
|
|
},
|
|
|
api_settings: {
|
|
|
- Icon: PaperPlaneIcon,
|
|
|
+ Icon: () => <i className="icon-fw icon-paper-plane"></i>,
|
|
|
Content: ApiSettings,
|
|
|
i18n: t('API Settings'),
|
|
|
index: 3,
|
|
|
},
|
|
|
};
|
|
|
+ }, [t]);
|
|
|
|
|
|
|
|
|
- return (
|
|
|
- <CustomNavigation navTabMapping={navTabMapping} />
|
|
|
- );
|
|
|
- }
|
|
|
+ return (
|
|
|
+ <CustomNavigation navTabMapping={navTabMapping} />
|
|
|
+ );
|
|
|
|
|
|
-}
|
|
|
+};
|
|
|
|
|
|
PersonalSettings.propTypes = {
|
|
|
t: PropTypes.func.isRequired, // i18next
|