Skip to content

Commit

Permalink
Fix microservice
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyjth committed Apr 18, 2024
1 parent b1ff8e0 commit 8d84805
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion micro-service/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
AppProvider,
createBrowserRouter,
RouterProvider,
NavigationProvider,
} from '@apollosproject/web-shared/providers';

import AppHeader from '@apollosproject/web-shared/components/AppHeader';
Expand Down Expand Up @@ -36,7 +37,9 @@ function App({ searchParams, url }) {
<>
<AppHeader />
<Styled.FeedWrapper>
<FeatureFeed featureFeed={`${type}:${randomId}`} church={churchSlug} />
<NavigationProvider>
<FeatureFeed featureFeed={`${type}:${randomId}`} church={churchSlug} />
</NavigationProvider>
</Styled.FeedWrapper>
</>
);
Expand Down
1 change: 0 additions & 1 deletion packages/web-shared/embeds/FeatureFeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { useNavigation } from '../providers/NavigationProvider';

function RenderFeatures(props) {
const { id } = useNavigation();

const { type, randomId } = parseSlugToIdAndType(id) ?? {};

const Component = getComponentFromType({ type, id: randomId });
Expand Down
2 changes: 1 addition & 1 deletion packages/web-shared/providers/NavigationProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const NavigationProvider = (props = {}) => {

if (shouldUsePathRouter) {
navigate = ({ id } = {}) => {
const type = id.includes('FeatureFeed') ? 'feed' : 'content';
const type = id?.includes('FeatureFeed') ? 'feed' : 'content';
if (id) {
nativeNavigate({
pathname: `/${type === 'content' ? 'ac' : 'af'}/${id}`,
Expand Down
2 changes: 2 additions & 0 deletions packages/web-shared/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ContentItemProvider from './ContentItemProvider';
import FeatureFeedProvider from './FeatureFeedProvider';
import ModalProvider from './ModalProvider';
import SearchProvider from './SearchProvider';
import NavigationProvider from './NavigationProvider';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';

export {
Expand All @@ -17,4 +18,5 @@ export {
SearchProvider,
createBrowserRouter,
RouterProvider,
NavigationProvider,
};

0 comments on commit 8d84805

Please sign in to comment.