From 8d8480541c02b926811d9cb8965669234fa1df66 Mon Sep 17 00:00:00 2001 From: Vincent Wilson Date: Thu, 18 Apr 2024 15:28:13 -0400 Subject: [PATCH] Fix microservice --- micro-service/src/App.js | 5 ++++- packages/web-shared/embeds/FeatureFeed.js | 1 - packages/web-shared/providers/NavigationProvider.js | 2 +- packages/web-shared/providers/index.js | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/micro-service/src/App.js b/micro-service/src/App.js index 9ae97bcf..7211997c 100644 --- a/micro-service/src/App.js +++ b/micro-service/src/App.js @@ -6,6 +6,7 @@ import { AppProvider, createBrowserRouter, RouterProvider, + NavigationProvider, } from '@apollosproject/web-shared/providers'; import AppHeader from '@apollosproject/web-shared/components/AppHeader'; @@ -36,7 +37,9 @@ function App({ searchParams, url }) { <> - + + + ); diff --git a/packages/web-shared/embeds/FeatureFeed.js b/packages/web-shared/embeds/FeatureFeed.js index 1c6330f0..f50b599f 100644 --- a/packages/web-shared/embeds/FeatureFeed.js +++ b/packages/web-shared/embeds/FeatureFeed.js @@ -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 }); diff --git a/packages/web-shared/providers/NavigationProvider.js b/packages/web-shared/providers/NavigationProvider.js index 9c6d83e9..ea0bc62b 100644 --- a/packages/web-shared/providers/NavigationProvider.js +++ b/packages/web-shared/providers/NavigationProvider.js @@ -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}`, diff --git a/packages/web-shared/providers/index.js b/packages/web-shared/providers/index.js index 76972b40..cb1cdd04 100644 --- a/packages/web-shared/providers/index.js +++ b/packages/web-shared/providers/index.js @@ -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 { @@ -17,4 +18,5 @@ export { SearchProvider, createBrowserRouter, RouterProvider, + NavigationProvider, };