diff --git a/packages/interface/src/layouts/types.ts b/packages/interface/src/layouts/types.ts index 4c1373e1..383e0621 100644 --- a/packages/interface/src/layouts/types.ts +++ b/packages/interface/src/layouts/types.ts @@ -27,5 +27,5 @@ export interface ILayoutProps extends PropsWithChildren { export interface IAdminLayoutProps extends PropsWithChildren { sidebar?: "left" | "right"; sidebarComponent?: ReactNode; - roundId?: string; + pollId?: string; } diff --git a/packages/interface/src/pages/index.tsx b/packages/interface/src/pages/index.tsx index a2fc5826..d1a3b6f9 100644 --- a/packages/interface/src/pages/index.tsx +++ b/packages/interface/src/pages/index.tsx @@ -19,13 +19,13 @@ const HomePage = (): JSX.Element => { const { isRegistered } = useMaci(); const isAdmin = useIsAdmin(); const { rounds } = useRound(); - const singleRound = useMemo(() => rounds?.[0], [rounds]); + const singleRound = useMemo(() => (rounds && rounds.length === 1 ? rounds[0] : undefined), [rounds]); return ( - {singleRound && rounds!.length === 1 && } + {singleRound && } - {rounds && rounds.length > 1 && ( + {!singleRound && (
{config.eventName} @@ -51,11 +51,11 @@ const HomePage = (): JSX.Element => {
)} - {isConnected && !isAdmin && rounds.length === 0 && ( + {isConnected && !isAdmin && rounds && rounds.length === 0 && (

There are no rounds deployed.

)} - + {rounds && rounds.length > 1 && } )} diff --git a/packages/interface/src/pages/rounds/[pollId]/applications/confirmation.tsx b/packages/interface/src/pages/rounds/[pollId]/applications/confirmation.tsx index 2bba6372..49b932a7 100644 --- a/packages/interface/src/pages/rounds/[pollId]/applications/confirmation.tsx +++ b/packages/interface/src/pages/rounds/[pollId]/applications/confirmation.tsx @@ -41,7 +41,7 @@ const ConfirmProjectPage = ({ pollId }: { pollId: string }): JSX.Element => { if (project === undefined) { return ( - +
@@ -54,7 +54,7 @@ const ConfirmProjectPage = ({ pollId }: { pollId: string }): JSX.Element => { } return ( - +
{project.recipient.initialized === false ? ( diff --git a/packages/interface/src/pages/rounds/[pollId]/applications/index.tsx b/packages/interface/src/pages/rounds/[pollId]/applications/index.tsx index 75203d03..c9257e5f 100644 --- a/packages/interface/src/pages/rounds/[pollId]/applications/index.tsx +++ b/packages/interface/src/pages/rounds/[pollId]/applications/index.tsx @@ -8,7 +8,7 @@ interface IApplicationsPageProps { } const ApplicationsPage = ({ pollId }: IApplicationsPageProps): JSX.Element => ( - + ); diff --git a/packages/interface/src/pages/rounds/[pollId]/applications/new.tsx b/packages/interface/src/pages/rounds/[pollId]/applications/new.tsx index 9d68eb84..5cab7af5 100644 --- a/packages/interface/src/pages/rounds/[pollId]/applications/new.tsx +++ b/packages/interface/src/pages/rounds/[pollId]/applications/new.tsx @@ -18,7 +18,7 @@ const NewProjectPage = ({ pollId }: { pollId: string }): JSX.Element => { const state = useRoundState({ pollId }); return ( - +