|
|
@@ -5,13 +5,16 @@ import { useTranslation } from 'react-i18next';
|
|
|
import {
|
|
|
Modal, ModalHeader, ModalBody,
|
|
|
} from 'reactstrap';
|
|
|
+
|
|
|
+import { useDescendantsPageListModal } from '~/stores/ui';
|
|
|
+import { useIsSharedUser } from '~/stores/context';
|
|
|
+
|
|
|
import DescendantsPageList from './DescendantsPageList';
|
|
|
import ExpandOrContractButton from './ExpandOrContractButton';
|
|
|
import { CustomNavTab } from './CustomNavigation/CustomNav';
|
|
|
import PageListIcon from './Icons/PageListIcon';
|
|
|
import TimeLineIcon from './Icons/TimeLineIcon';
|
|
|
import CustomTabContent from './CustomNavigation/CustomTabContent';
|
|
|
-import { useDescendantsPageListModal } from '~/stores/ui';
|
|
|
import PageTimeline from './PageTimeline';
|
|
|
|
|
|
|
|
|
@@ -24,6 +27,8 @@ export const DescendantsPageListModal = (props: Props): JSX.Element => {
|
|
|
const [activeTab, setActiveTab] = useState('pagelist');
|
|
|
const [isWindowExpanded, setIsWindowExpanded] = useState(false);
|
|
|
|
|
|
+ const { data: isSharedUser } = useIsSharedUser();
|
|
|
+
|
|
|
const { data: status, close } = useDescendantsPageListModal();
|
|
|
|
|
|
const navTabMapping = useMemo(() => {
|
|
|
@@ -38,15 +43,17 @@ export const DescendantsPageListModal = (props: Props): JSX.Element => {
|
|
|
},
|
|
|
i18n: t('page_list'),
|
|
|
index: 0,
|
|
|
+ isLinkEnabled: () => !isSharedUser,
|
|
|
},
|
|
|
timeline: {
|
|
|
Icon: TimeLineIcon,
|
|
|
Content: () => <PageTimeline />,
|
|
|
i18n: t('Timeline View'),
|
|
|
index: 1,
|
|
|
+ isLinkEnabled: () => !isSharedUser,
|
|
|
},
|
|
|
};
|
|
|
- }, [status, t]);
|
|
|
+ }, [isSharedUser, status, t]);
|
|
|
|
|
|
const buttons = useMemo(() => (
|
|
|
<div className="d-flex flex-nowrap">
|