Skip to content
Merged
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
2 changes: 1 addition & 1 deletion packages/nextjs/app/analytics/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import dynamic from "next/dynamic";
import { useState, useEffect } from "use client";
import { useState, useEffect } from "react";
import type { AnalyticsDashboardData, TimePeriod } from "~~/types/analytics";
import { analyticsService } from "~~/services/analytics";

Expand Down
8 changes: 2 additions & 6 deletions packages/nextjs/app/debug/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import dynamic from "next/dynamic";
import type { NextPage } from "next";
import { getMetadata } from "~~/utils/scaffold-eth/getMetadata";

// Dynamic import for DebugContracts to reduce initial bundle size
const DebugContracts = dynamic(() => import("./_components/DebugContracts").then(mod => ({ default: mod.DebugContracts })), {
Expand All @@ -12,11 +13,6 @@ const DebugContracts = dynamic(() => import("./_components/DebugContracts").then
ssr: false,
});

export const metadata = getMetadata({
title: "Debug Contracts",
description: "Debug your deployed 🏗 Scaffold-ETH 2 contracts in an easy way",
});

const Debug: NextPage = () => {
return (
<>
Expand Down
1 change: 0 additions & 1 deletion packages/nextjs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { PWAProvider } from "~~/components/pwa/PWAProvider";
import { AccessibilityProvider } from "~~/components/accessibility";
import { I18nProvider } from "~~/components/i18n";
import "~~/styles/globals.css";
import "~~/styles/accessibility.css";
import { getMetadata, getViewport } from "~~/utils/scaffold-eth/getMetadata";

export const metadata = getMetadata({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { useState, useRef } from 'react';
import { useAccount } from 'wagmi';
import { useVoicePay } from '~/hooks/useVoicePay';
import { useVoicePay } from '~~/hooks/useVoicePay';
import { VoiceRecorder } from './VoiceRecorder';
import { RealBalanceDisplay } from './RealBalanceDisplay';
import { PaymentConfirmationModal } from './PaymentConfirmationModal';
Expand Down
69 changes: 46 additions & 23 deletions packages/nextjs/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,51 @@ import ig from './locales/ig.json';
import sw from './locales/sw.json';
import ar from './locales/ar.json';

i18n
.use(LanguageDetector) // Detect user language
.use(initReactI18next) // React integration
.init({
resources: {
en: { translation: en },
fr: { translation: fr },
tw: { translation: tw },
ha: { translation: ha },
yo: { translation: yo },
ig: { translation: ig },
sw: { translation: sw },
ar: { translation: ar },
},
fallbackLng: 'en',
interpolation: {
escapeValue: false, // React already escapes
},
detection: {
order: ['localStorage', 'navigator', 'htmlTag'],
caches: ['localStorage'],
},
});
// Only initialize on client side
if (typeof window !== 'undefined') {
i18n
.use(LanguageDetector) // Detect user language
.use(initReactI18next) // React integration
.init({
resources: {
en: { translation: en },
fr: { translation: fr },
tw: { translation: tw },
ha: { translation: ha },
yo: { translation: yo },
ig: { translation: ig },
sw: { translation: sw },
ar: { translation: ar },
},
fallbackLng: 'en',
interpolation: {
escapeValue: false, // React already escapes
},
detection: {
order: ['localStorage', 'navigator', 'htmlTag'],
caches: ['localStorage'],
},
});
} else {
// Server-side initialization (minimal)
i18n
.use(initReactI18next)
.init({
resources: {
en: { translation: en },
fr: { translation: fr },
tw: { translation: tw },
ha: { translation: ha },
yo: { translation: yo },
ig: { translation: ig },
sw: { translation: sw },
ar: { translation: ar },
},
fallbackLng: 'en',
interpolation: {
escapeValue: false,
},
});
}

export default i18n;
11 changes: 10 additions & 1 deletion packages/nextjs/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,17 @@ const nextConfig: NextConfig = {
"react-hot-toast",
],
},
webpack: config => {
webpack: (config, { isServer }) => {
// Polyfill 'self' for server-side builds
if (isServer) {
config.resolve.fallback = {
...config.resolve.fallback,
'self': false,
};
}

config.resolve.fallback = {
...config.resolve.fallback,
fs: false,
net: false,
tls: false,
Expand Down
3 changes: 3 additions & 0 deletions packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
"react-dom": "^19.0.0",
"react-hot-toast": "^2.4.0",
"react-i18next": "^16.5.0",
"react-is": "18.3.1",
"recharts": "^3.5.1",
"usehooks-ts": "^3.1.0",
"viem": "^2.37.9",
"wagmi": "^2.16.4",
Expand All @@ -65,6 +67,7 @@
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/node": "^18.19.50",
"@types/react": "^19.0.7",
"@types/react-is": "^19",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/coverage-v8": "^1.0.4",
"abitype": "1.0.6",
Expand Down
1 change: 0 additions & 1 deletion packages/nextjs/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
plugins: {
'@tailwindcss/postcss': {},
'tailwindcss-rtl': {},
},
};
219 changes: 0 additions & 219 deletions packages/nextjs/styles/accessibility.css

This file was deleted.

Loading
Loading