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";
|
import type { NextConfig } from "next";
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
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() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<MembershipRegistration />
|
<MembershipRegistration tabId="membership" />
|
||||||
<KeystoreManagement />
|
<KeystoreManagement tabId="keystore" />
|
||||||
</Layout>
|
</Layout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -15,20 +15,15 @@ const tabs = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const componentToTabId: Record<string, string> = {
|
|
||||||
MembershipRegistration: 'membership',
|
|
||||||
KeystoreManagement: 'keystore',
|
|
||||||
};
|
|
||||||
|
|
||||||
export function Layout({ children }: { children: React.ReactNode }) {
|
export function Layout({ children }: { children: React.ReactNode }) {
|
||||||
const { activeTab, setActiveTab } = useAppState();
|
const { activeTab, setActiveTab } = useAppState();
|
||||||
const childrenArray = Children.toArray(children);
|
const childrenArray = Children.toArray(children);
|
||||||
|
|
||||||
const getTabContent = (tabId: string) => {
|
const getTabContent = (tabId: string) => {
|
||||||
return childrenArray.find((child) => {
|
return childrenArray.find((child) => {
|
||||||
if (isValidElement(child) && typeof child.type === 'function') {
|
if (isValidElement(child)) {
|
||||||
const componentName = child.type.name;
|
const props = child.props as { tabId?: string };
|
||||||
return componentToTabId[componentName] === tabId;
|
return props.tabId === tabId;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -31,7 +31,12 @@ interface ExtendedMembershipInfo extends Omit<MembershipInfo, 'state'> {
|
|||||||
token: string;
|
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 {
|
const {
|
||||||
hasStoredCredentials,
|
hasStoredCredentials,
|
||||||
storedCredentialsHashes,
|
storedCredentialsHashes,
|
||||||
|
|||||||
@ -11,7 +11,12 @@ import { Button } from '../../ui/button';
|
|||||||
import { membershipRegistration, type ContentSegment } from '../../../content/index';
|
import { membershipRegistration, type ContentSegment } from '../../../content/index';
|
||||||
import { toast } from 'sonner';
|
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 { registerMembership, isInitialized, isStarted, rateMinLimit, rateMaxLimit, error, isLoading } = useRLN();
|
||||||
const { isConnected, chainId } = useWallet();
|
const { isConnected, chainId } = useWallet();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user