|
@@ -1,8 +1,13 @@
|
|
|
-import React, { FC, useState } from 'react';
|
|
|
|
|
|
|
+import React, { FC, useState, useMemo } from 'react';
|
|
|
|
|
|
|
|
|
|
+import { useTranslation } from 'react-i18next';
|
|
|
import InAppNotificationList from './InAppNotificationList';
|
|
import InAppNotificationList from './InAppNotificationList';
|
|
|
import { useSWRxInAppNotifications } from '../../stores/in-app-notification';
|
|
import { useSWRxInAppNotifications } from '../../stores/in-app-notification';
|
|
|
import PaginationWrapper from '../PaginationWrapper';
|
|
import PaginationWrapper from '../PaginationWrapper';
|
|
|
|
|
+import CustomNavAndContents from '../CustomNavigation/CustomNavAndContents';
|
|
|
|
|
+
|
|
|
|
|
+import UserSettings from '../Me/UserSettings';
|
|
|
|
|
+import PasswordSettings from '../Me/PasswordSettings';
|
|
|
|
|
|
|
|
|
|
|
|
|
const AllInAppNotifications: FC = () => {
|
|
const AllInAppNotifications: FC = () => {
|
|
@@ -10,6 +15,25 @@ const AllInAppNotifications: FC = () => {
|
|
|
const [offset, setOffset] = useState(0);
|
|
const [offset, setOffset] = useState(0);
|
|
|
const limit = 10;
|
|
const limit = 10;
|
|
|
const { data: inAppNotificationData } = useSWRxInAppNotifications(limit, offset);
|
|
const { data: inAppNotificationData } = useSWRxInAppNotifications(limit, offset);
|
|
|
|
|
+ const { t } = useTranslation();
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ const navTabMapping = useMemo(() => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ user_infomation: {
|
|
|
|
|
+ Icon: () => <i className="icon-fw icon-user"></i>,
|
|
|
|
|
+ Content: UserSettings,
|
|
|
|
|
+ i18n: t('User Information'),
|
|
|
|
|
+ index: 0,
|
|
|
|
|
+ },
|
|
|
|
|
+ external_accounts: {
|
|
|
|
|
+ Icon: () => <i className="icon-fw icon-share-alt"></i>,
|
|
|
|
|
+ Content: PasswordSettings,
|
|
|
|
|
+ i18n: t('admin:user_management.external_accounts'),
|
|
|
|
|
+ index: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+ };
|
|
|
|
|
+ }, [t]);
|
|
|
|
|
|
|
|
if (inAppNotificationData == null) {
|
|
if (inAppNotificationData == null) {
|
|
|
return (
|
|
return (
|
|
@@ -21,6 +45,7 @@ const AllInAppNotifications: FC = () => {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
const setPageNumber = (selectedPageNumber): void => {
|
|
const setPageNumber = (selectedPageNumber): void => {
|
|
|
setActivePage(selectedPageNumber);
|
|
setActivePage(selectedPageNumber);
|
|
|
const offset = (selectedPageNumber - 1) * limit;
|
|
const offset = (selectedPageNumber - 1) * limit;
|
|
@@ -29,7 +54,8 @@ const AllInAppNotifications: FC = () => {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- <InAppNotificationList inAppNotificationData={inAppNotificationData} />
|
|
|
|
|
|
|
+ <CustomNavAndContents navTabMapping={navTabMapping} />
|
|
|
|
|
+ {/* <InAppNotificationList inAppNotificationData={inAppNotificationData} />
|
|
|
<PaginationWrapper
|
|
<PaginationWrapper
|
|
|
activePage={activePage}
|
|
activePage={activePage}
|
|
|
changePage={setPageNumber}
|
|
changePage={setPageNumber}
|
|
@@ -37,7 +63,7 @@ const AllInAppNotifications: FC = () => {
|
|
|
pagingLimit={inAppNotificationData.limit}
|
|
pagingLimit={inAppNotificationData.limit}
|
|
|
align="center"
|
|
align="center"
|
|
|
size="sm"
|
|
size="sm"
|
|
|
- />
|
|
|
|
|
|
|
+ /> */}
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|