mirror of
https://github.com/logos-messaging/rln.waku.org.git
synced 2026-01-02 14:13:09 +00:00
fix: production build tab rendering
This commit is contained in:
parent
d473ddb823
commit
046b7427ed
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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>
|
||||
);
|
||||
}
|
||||
@ -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;
|
||||
});
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user