diff --git a/src/group/components/GroupView.js b/src/group/components/GroupView.js index adc0088b8..d1ff24cd6 100644 --- a/src/group/components/GroupView.js +++ b/src/group/components/GroupView.js @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect } from 'react'; +import React, { useCallback, useEffect, useMemo } from 'react'; import _ from 'lodash/fp'; import { useTranslation } from 'react-i18next'; @@ -24,6 +24,7 @@ import PageContainer from 'layout/PageContainer'; import PageHeader from 'layout/PageHeader'; import PageLoader from 'layout/PageLoader'; import { useRefreshProgressContext } from 'layout/RefreshProgressProvider'; +import { useBreadcrumbsParams } from 'navigation/breadcrumbsContext'; import Restricted from 'permissions/components/Restricted'; import { GroupContextProvider } from 'group/groupContext'; @@ -142,6 +143,13 @@ const GroupView = () => { fetching ); + useBreadcrumbsParams( + useMemo( + () => ({ groupName: group?.name, loading: !group?.name }), + [group?.name] + ) + ); + useEffect(() => { dispatch(fetchGroupView(slug)); }, [dispatch, slug]); diff --git a/src/group/membership/components/GroupMembers.js b/src/group/membership/components/GroupMembers.js index 51b98b268..acc34a5a0 100644 --- a/src/group/membership/components/GroupMembers.js +++ b/src/group/membership/components/GroupMembers.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useMemo } from 'react'; import _ from 'lodash/fp'; import { usePermission } from 'permissions'; @@ -12,6 +12,7 @@ import { useDocumentTitle } from 'common/document'; import PageContainer from 'layout/PageContainer'; import PageHeader from 'layout/PageHeader'; import PageLoader from 'layout/PageLoader'; +import { useBreadcrumbsParams } from 'navigation/breadcrumbsContext'; import { GroupContextProvider } from 'group/groupContext'; import { fetchGroupForMembers } from 'group/groupSlice'; @@ -40,6 +41,13 @@ const Header = () => { fetching ); + useBreadcrumbsParams( + useMemo( + () => ({ groupName: group?.name, loading: !group?.name }), + [group?.name] + ) + ); + const { loading: loadingPermissions, allowed } = usePermission( 'group.manageMembers', group diff --git a/src/index.js b/src/index.js index cf400b7de..c2b4888c0 100644 --- a/src/index.js +++ b/src/index.js @@ -17,6 +17,8 @@ import theme from 'theme'; import 'index.css'; +import Breadcrumbs from 'navigation/Breadcrumbs'; + const App = () => { const contentRef = useRef(); const navigationRef = useRef(); @@ -43,6 +45,7 @@ const App = () => { flex: 1, }} > +