Skip to content

Commit

Permalink
96894 - reverting from bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jquispe-oddball committed Dec 26, 2024
1 parent 3d4b9a1 commit b5298f0
Showing 1 changed file with 21 additions and 25 deletions.
46 changes: 21 additions & 25 deletions src/applications/accredited-representative-portal/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@ import POARequestsPage, {
poaRequestsLoader,
} from './containers/POARequestsPage';
import SignedInLayoutWrapper from './containers/SignedInLayoutWrapper';
import POARequestDetailsPage from './containers/POARequestDetailsPage';
import { poaRequestsLoader } from './loaders/poaRequestsLoader';
import { poaRequestLoader } from './loaders/poaRequestLoader';
import POARequestDetailsPage, {
poaRequestLoader,
} from './containers/POARequestDetailsPage';
import ErrorMessage from './components/common/ErrorMessage';
import POARequestsCard from './components/POARequestsCard/POARequestsCard';

const LoadingWrapper = () => {
const navigation = useNavigation();

if (navigation.state === 'loading') {
return <VaLoadingIndicator message="Loading..." />;
}

return <Outlet />;
};

const router = createBrowserRouter(
[
Expand All @@ -27,35 +36,22 @@ const router = createBrowserRouter(
element: <SignedInLayoutWrapper />,
children: [
{
path: 'poa-requests',
element: <POARequestsPage />,
loader: poaRequestsLoader,
errorElement: <ErrorMessage />,
element: <LoadingWrapper />,
children: [
{
index: true,
loader: poaRequestsLoader,
element: <POARequestsCard cssClass="pending" />,
},
{
index: true,
path: 'pending',
path: 'poa-requests',
element: <POARequestsPage />,
loader: poaRequestsLoader,
element: <POARequestsCard cssClass="pending" />,
errorElement: <ErrorMessage />,
},
{
path: 'completed',
// loader: poaRequestsCompletedLoader,
element: <POARequestsCard cssClass="completed" />,
path: 'poa-requests/:id',
element: <POARequestDetailsPage />,
loader: poaRequestLoader,
errorElement: <ErrorMessage />,
},
],
},
{
path: 'poa-requests/:id',
element: <POARequestDetailsPage />,
loader: poaRequestLoader,
errorElement: <ErrorMessage />,
},
],
},
],
Expand Down

0 comments on commit b5298f0

Please sign in to comment.