fix: production build tab rendering

This commit is contained in:
Danish Arora 2025-04-18 13:36:29 +05:30
parent d473ddb823
commit 046b7427ed
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
6 changed files with 27 additions and 29 deletions

View File

@ -1,14 +0,0 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
domains: [
'waku.org',
'logos.co',
'contributors.free.technology'
],
},
reactStrictMode: true,
output: 'export',
}
module.exports = nextConfig

View File

@ -1,7 +1,14 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
};
images: {
domains: [
'waku.org',
'logos.co',
'contributors.free.technology'
],
},
reactStrictMode: true,
}
export default nextConfig;
module.exports = nextConfig

View File

@ -8,8 +8,8 @@ import { KeystoreManagement } from '../components/Tabs/KeystoreTab/KeystoreManag
export default function Home() {
return (
<Layout>
<MembershipRegistration />
<KeystoreManagement />
<MembershipRegistration tabId="membership" />
<KeystoreManagement tabId="keystore" />
</Layout>
);
}

View File

@ -15,20 +15,15 @@ const tabs = [
},
];
const componentToTabId: Record<string, string> = {
MembershipRegistration: 'membership',
KeystoreManagement: 'keystore',
};
export function Layout({ children }: { children: React.ReactNode }) {
const { activeTab, setActiveTab } = useAppState();
const childrenArray = Children.toArray(children);
const getTabContent = (tabId: string) => {
return childrenArray.find((child) => {
if (isValidElement(child) && typeof child.type === 'function') {
const componentName = child.type.name;
return componentToTabId[componentName] === tabId;
if (isValidElement(child)) {
const props = child.props as { tabId?: string };
return props.tabId === tabId;
}
return false;
});

View File

@ -31,7 +31,12 @@ interface ExtendedMembershipInfo extends Omit<MembershipInfo, 'state'> {
token: string;
}
export function KeystoreManagement() {
interface KeystoreManagementProps {
tabId?: string;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function KeystoreManagement({ tabId: _tabId }: KeystoreManagementProps) {
const {
hasStoredCredentials,
storedCredentialsHashes,

View File

@ -11,7 +11,12 @@ import { Button } from '../../ui/button';
import { membershipRegistration, type ContentSegment } from '../../../content/index';
import { toast } from 'sonner';
export function MembershipRegistration() {
interface MembershipRegistrationProps {
tabId?: string;
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function MembershipRegistration({ tabId: _tabId }: MembershipRegistrationProps) {
const { registerMembership, isInitialized, isStarted, rateMinLimit, rateMaxLimit, error, isLoading } = useRLN();
const { isConnected, chainId } = useWallet();