Skip to content

Commit

Permalink
Merge pull request #316 from ourzora/fix-profile-issues
Browse files Browse the repository at this point in the history
Fix links and pagination on profile page
  • Loading branch information
neokry authored Jul 24, 2023
2 parents b5b7d70 + e371cf9 commit a7e7a29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apps/web/src/data/subgraph/requests/tokensQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { OrderDirection, TokenFragment, Token_OrderBy } from '../sdk.generated'

export interface TokensQueryResponse {
tokens: TokenFragment[]
hasNextPage: boolean
}

export const tokensQuery = async (
Expand All @@ -25,5 +26,6 @@ export const tokensQuery = async (

return {
tokens: res.tokens,
hasNextPage: res.tokens.length === limit,
}
}
6 changes: 3 additions & 3 deletions apps/web/src/pages/profile/[user].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const ProfilePage: NextPageWithLayout<ProfileProps> = ({ userAddress }) => {
const isLoading = data ? false : isValidating && !data && !error
const hasDaos = !!daos && daos.length > 0

const { handlePageBack, handlePageForward } = usePagination(!!tokens?.tokens.length)
const { handlePageBack, handlePageForward } = usePagination(tokens?.hasNextPage)

const daosString = daos?.map((x) => x.name).join(', ')

Expand Down Expand Up @@ -173,7 +173,7 @@ const ProfilePage: NextPageWithLayout<ProfileProps> = ({ userAddress }) => {
{tokens?.tokens.map((x, i) => (
<Link
key={i}
href={`/dao/${query.network}/${x.tokenContract}/${x.tokenId}`}
href={`/dao/${chain.slug}/${x.tokenContract}/${x.tokenId}`}
>
<TokenPreview name={x.name} image={x.image} />
</Link>
Expand All @@ -192,7 +192,7 @@ const ProfilePage: NextPageWithLayout<ProfileProps> = ({ userAddress }) => {
<Pagination
onNext={handlePageForward}
onPrev={handlePageBack}
isLast={!tokens?.tokens.length}
isLast={!tokens?.hasNextPage}
isFirst={!page}
/>
</>
Expand Down

2 comments on commit a7e7a29

@vercel
Copy link

@vercel vercel bot commented on a7e7a29 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on a7e7a29 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

testnet-nouns-builder – ./apps/web

testnet.nouns.build
testnet-nouns-builder-nouns-builder.vercel.app
testnet-nouns-builder-git-main-nouns-builder.vercel.app

Please sign in to comment.