Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 0 additions & 165 deletions web-marketplace/src/app/[lang]/project/[id]/page.tsx

This file was deleted.

6 changes: 6 additions & 0 deletions web-marketplace/src/clients/regen/Regen.Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ const BasketDetails = safeLazy(
);
const BuyCredits = safeLazy(() => import('../../legacy-pages/BuyCredits'));
const Sell = safeLazy(() => import('../../legacy-pages/Sell/Sell'));
const ProjectDetails = safeLazy(() =>
import('../../components/templates/ProjectDetails/ProjectDetails').then(
mod => ({ default: mod.ProjectDetails }),
),
);

const ChooseCreditClassPage = safeLazy(
() => import('../../legacy-pages/ChooseCreditClass'),
Expand Down Expand Up @@ -300,6 +305,7 @@ export const getRegenRoutes = ({
/>
<Route path="prefinance" element={<PrefinanceProjects />} />
</Route>
<Route path="project/:projectId" element={<ProjectDetails />} />
<Route path="project/:projectId/buy" element={<BuyCredits />} />
<Route
path="post/:iri"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';

import { useCallback, useMemo, useState } from 'react';
import { useParams } from 'react-router-dom';
import {
ApolloClient,
NormalizedCacheObject,
Expand All @@ -17,7 +18,6 @@ import { CREATE_POST_DISABLED_TOOLTIP_TEXT } from 'legacy-pages/Dashboard/MyProj
import { SOLD_OUT_TOOLTIP } from 'legacy-pages/Projects/AllProjects/AllProjects.constants';
import { getPriceToDisplay } from 'legacy-pages/Projects/hooks/useProjectsSellOrders.utils';
import dynamic from 'next/dynamic';
import { useParams } from 'next/navigation';

import ContainedButton from 'web-components/src/components/buttons/ContainedButton';
import { PrefinanceIcon } from 'web-components/src/components/icons/PrefinanceIcon';
Expand Down Expand Up @@ -103,7 +103,7 @@ const Media = dynamic(
function ProjectDetails(): JSX.Element {
const { _ } = useLingui();
const [selectedLanguage] = useAtom(selectedLanguageAtom);
const { id: projectId } = useParams<{ id: string }>();
const { projectId } = useParams<{ projectId: string }>();
const { queryClient } = useLedger();
const { isConnected, isKeplrMobileWeb, wallet, loginDisabled } = useWallet();
const graphqlClient =
Expand Down
18 changes: 16 additions & 2 deletions web-marketplace/src/legacy-pages/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { Suspense, useEffect, useMemo, useRef, useState } from 'react';
import { Outlet, useLocation, useNavigate } from 'react-router-dom';
import {
ApolloClient,
Expand Down Expand Up @@ -78,13 +78,25 @@ import { useBridgeAvailability } from './hooks/useBridgeAvailabilty';
import { usePathSection } from './hooks/usePathSection';
import { useFetchProjectByAdmin } from './MyProjects/hooks/useFetchProjectsByAdmin';

// Preload lazy-loaded dashboard sub-pages to prevent flash on first navigation
const preloadDashboardPages = () => {
import('../Orders');
import('./Members');
import('../Sell/Sell');
};

export const Dashboard = () => {
const { _ } = useLingui();
const [selectedLanguage] = useAtom(selectedLanguageAtom);
const { accountChanging, disconnect, loginDisabled, wallet } = useWallet();
const { loading, activeAccount, activeAccountId, privActiveAccount } =
useAuth();

// Preload dashboard sub-pages on mount to eliminate navigation flash
useEffect(() => {
preloadDashboardPages();
}, []);

const [isWarningModalOpen, setIsWarningModalOpen] = useState<
string | undefined
>(undefined);
Expand Down Expand Up @@ -631,7 +643,9 @@ export const Dashboard = () => {
'lg:mt-30 min-h-[520px]',
)}
>
<Outlet context={dashboardContextValue} />
<Suspense fallback={null}>
<Outlet context={dashboardContextValue} />
</Suspense>
</div>
</WithLoader>
</div>
Expand Down
Loading