From 149d009f037f5bec581f2d46dda5c490f5cca66e Mon Sep 17 00:00:00 2001
From: Trung-Tin Pham <60747384+AtelyPham@users.noreply.github.com>
Date: Thu, 11 Jul 2024 11:50:40 +0700
Subject: [PATCH] fix(tangle-dapp): Fix Timed Out Error (#2427)
---
apps/tangle-dapp/app/api/hello/route.ts | 3 ---
apps/tangle-dapp/app/claim/layout.tsx | 2 ++
apps/tangle-dapp/app/claim/page.tsx | 2 ++
apps/tangle-dapp/app/layout.tsx | 2 ++
.../nomination/[validatorAddress]/page.tsx | 2 ++
apps/tangle-dapp/app/nomination/layout.tsx | 2 ++
apps/tangle-dapp/app/nomination/page.tsx | 2 ++
apps/tangle-dapp/app/page.tsx | 27 +++++--------------
8 files changed, 19 insertions(+), 23 deletions(-)
delete mode 100644 apps/tangle-dapp/app/api/hello/route.ts
diff --git a/apps/tangle-dapp/app/api/hello/route.ts b/apps/tangle-dapp/app/api/hello/route.ts
deleted file mode 100644
index 3bbf325cbf..0000000000
--- a/apps/tangle-dapp/app/api/hello/route.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export async function GET() {
- return new Response('Hello, from API!');
-}
diff --git a/apps/tangle-dapp/app/claim/layout.tsx b/apps/tangle-dapp/app/claim/layout.tsx
index 856901ea40..697eed9005 100644
--- a/apps/tangle-dapp/app/claim/layout.tsx
+++ b/apps/tangle-dapp/app/claim/layout.tsx
@@ -8,6 +8,8 @@ import faqItems from '../../constants/faq';
import { OpenGraphPageImageUrl } from '../../constants/openGraph';
import createPageMetadata from '../../utils/createPageMetadata';
+export const dynamic = 'force-static';
+
export const metadata: Metadata = createPageMetadata({
title: 'Claim Airdrop',
imageUrl: OpenGraphPageImageUrl.ClaimAirdrop,
diff --git a/apps/tangle-dapp/app/claim/page.tsx b/apps/tangle-dapp/app/claim/page.tsx
index 60c6166290..a53ec89b25 100644
--- a/apps/tangle-dapp/app/claim/page.tsx
+++ b/apps/tangle-dapp/app/claim/page.tsx
@@ -19,6 +19,8 @@ import EligibleSection from './EligibleSection';
import NotEligibleSection from './NotEligibleSection';
import type { ClaimInfoType } from './types';
+export const dynamic = 'force-static';
+
export default function ClaimPage() {
const { toggleModal, isWalletConnected } = useConnectWallet();
const { activeAccount, loading, isConnecting } = useWebContext();
diff --git a/apps/tangle-dapp/app/layout.tsx b/apps/tangle-dapp/app/layout.tsx
index 38c4b3b09c..a3e3b58af9 100644
--- a/apps/tangle-dapp/app/layout.tsx
+++ b/apps/tangle-dapp/app/layout.tsx
@@ -13,6 +13,8 @@ import { DEFAULT_OPENGRAPH_METADATA } from '../constants/openGraph';
import { Layout } from '../containers';
import Providers from './providers';
+export const dynamic = 'force-static';
+
export const viewport: Viewport = {
themeColor: [
{ media: '(prefers-color-scheme: light)', color: '#fff' },
diff --git a/apps/tangle-dapp/app/nomination/[validatorAddress]/page.tsx b/apps/tangle-dapp/app/nomination/[validatorAddress]/page.tsx
index 21dae3baf4..a943073162 100644
--- a/apps/tangle-dapp/app/nomination/[validatorAddress]/page.tsx
+++ b/apps/tangle-dapp/app/nomination/[validatorAddress]/page.tsx
@@ -6,6 +6,8 @@ import InfoCard from './InfoCard';
import NodeSpecificationsTable from './NodeSpecificationsTable';
import ServiceTableTabs from './ServiceTableTabs';
+export const dynamic = 'force-static';
+
// TODO: might need to add metadata here
export default function ValidatorDetails({
diff --git a/apps/tangle-dapp/app/nomination/layout.tsx b/apps/tangle-dapp/app/nomination/layout.tsx
index 3b589a5925..ce771ab0d6 100644
--- a/apps/tangle-dapp/app/nomination/layout.tsx
+++ b/apps/tangle-dapp/app/nomination/layout.tsx
@@ -2,6 +2,8 @@ import { PropsWithChildren } from 'react';
import { BalancesProvider } from '../../context/BalancesContext';
+export const dynamic = 'force-static';
+
export default function Layout({ children }: PropsWithChildren) {
return