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/micro-service/src/app/[[...slug]]/page.js b/micro-service/src/app/[[...slug]]/page.js index e64701fc..96ece709 100644 --- a/micro-service/src/app/[[...slug]]/page.js +++ b/micro-service/src/app/[[...slug]]/page.js @@ -7,7 +7,7 @@ import Head from 'next/head'; export const dynamic = 'force-dynamic'; -export async function generateMetadata({ params, searchParams }, parent) { +export async function generateMetadata({ searchParams }, parent) { const id = searchParams?.id; if (!id) return parent; diff --git a/packages/web-shared/components/Breadcrumbs/Breadcrumbs.js b/packages/web-shared/components/Breadcrumbs/Breadcrumbs.js deleted file mode 100644 index ba63e578..00000000 --- a/packages/web-shared/components/Breadcrumbs/Breadcrumbs.js +++ /dev/null @@ -1,75 +0,0 @@ -import React, { useEffect, useRef } from 'react'; -import { useSearchParams, useNavigate, useLocation } from 'react-router-dom'; -import { CaretRight } from '@phosphor-icons/react'; -import { Box, Button, SystemText } from '../../ui-kit'; -import { - remove as removeBreadcrumb, - reset as resetBreadcrumb, - set as setBreadcrumb, - useBreadcrumb, -} from '../../providers/BreadcrumbProvider'; - -function Breadcrumbs(props = {}) { - const navigate = useNavigate(); - const location = useLocation(); - const [searchParams, setSearchParams] = useSearchParams(); - const [state, dispatch] = useBreadcrumb(); - const prevStateRef = useRef(state); - const currentState = state[state.length - 1]; - - function handleBreadClick({ id, url }) { - dispatch(removeBreadcrumb(id)); - setSearchParams(`${url}`); - } - - const pathname = window.location.pathname; - const dynamicRoute = /^\/[a-z0-9-]+$/i; - - if (state.length === 0) { - return null; - } - - return ( - -