-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: proposals list pagination & added: proposals slice and proposal …
…screen
- Loading branch information
Showing
38 changed files
with
932 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use client'; | ||
|
||
import { useEffect } from 'react'; | ||
|
||
import { Container } from '../components/primitives/Container'; | ||
import { Loading } from '../components/ProposalsList/Loading'; | ||
import { ProposalListItemWrapper } from '../components/ProposalsList/ProposalListItemWrapper'; | ||
import { PAGE_SIZE } from '../configs/configs'; | ||
|
||
export default function LoadingPage() { | ||
useEffect(() => { | ||
window.scroll(0, 0); | ||
}, []); | ||
return ( | ||
<Container> | ||
{Array.from({ length: PAGE_SIZE }).map((_, index) => ( | ||
<ProposalListItemWrapper key={index}> | ||
<Loading /> | ||
</ProposalListItemWrapper> | ||
))} | ||
</Container> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Metadata } from 'next'; | ||
import { notFound } from 'next/navigation'; | ||
import React from 'react'; | ||
|
||
import { metaTexts } from '../../../helpers/texts/metaTexts'; | ||
import { api } from '../../../trpc/server'; | ||
|
||
export const metadata: Metadata = { | ||
title: metaTexts.ipfsTitle, | ||
description: metaTexts.ipfsDescription, | ||
openGraph: { | ||
images: ['/metaLogo.jpg'], | ||
title: metaTexts.ipfsTitle, | ||
description: metaTexts.ipfsDescription, | ||
}, | ||
}; | ||
|
||
export async function generateStaticParams() { | ||
const proposalsCount = await api.configs.getProposalsCount(); | ||
return [...Array(Number(proposalsCount)).keys()].map((proposalId) => ({ | ||
proposalId: String(proposalId), | ||
fallback: false, | ||
})); | ||
} | ||
|
||
export const revalidate = 3600; | ||
|
||
export default function Page({ params }: { params: { proposalId: string } }) { | ||
const proposalId = +params.proposalId; | ||
if (isNaN(proposalId)) { | ||
notFound(); // TODO: should be dynamic proposal page | ||
} | ||
return <h1>Proposal id {proposalId}</h1>; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
75f9626
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit was deployed on ipfs