Skip to content

[Feature✨] Add curation tab to user profile #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import Display from '@pages/profile'
import Collections from '@pages/profile/collections'
import Creations from '@pages/profile/creations'
import Collabs from '@pages/profile/collabs'
import Curation from '@pages/profile/curation'

import Sync from '@pages/sync'
import { Terms } from '@pages/terms'
Expand All @@ -83,6 +84,7 @@ const display_routes = (
<>
<Route index element={<Creations />} />
<Route exact path="collection" element={<Collections />} />
<Route exact path="curation" element={<Curation />} />
<Route exact path="collabs" element={<Collabs />} />
</>
)
Expand Down
49 changes: 49 additions & 0 deletions src/pages/profile/curation.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { gql } from 'graphql-request'
import TokenCollection from '@atoms/token-collection'
import { BaseTokenFieldsFragment } from '@data/api'
import { useOutletContext } from 'react-router'

export default function Curation() {
const { showRestricted, overrideProtections, address } = useOutletContext()

return (
<TokenCollection
showRestricted={showRestricted}
overrideProtections={overrideProtections}
label="Artist's Curation"
namespace="curation"
swrParams={[address]}
variables={{ address }}
emptyMessage="no curated tokens"
maxItems={null}
extractTokensFromResponse={(data) => {
return data.listings.map(({ token, seller_address }) => ({
...token,
listing_seller_address: seller_address,
key: token.token_id,
}))
}}
query={gql`
${BaseTokenFieldsFragment}
query curatorGallery($address: String!) {
listings(
where: {
token: { artist_address: { _neq: $address } }
seller_address: { _eq: $address }
status: { _eq: "active" }
}
distinct_on: token_id
) {
seller_address
token {
...baseTokenFields
}
contract_address
amount_left
price
}
}
`}
/>
)
}
1 change: 1 addition & 0 deletions src/pages/profile/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export default function Display() {
const TABS = [
{ title: 'Creations', to: '' },
{ title: 'Collection', to: 'collection' },
{ title: 'Curation', to: 'curation' },
{ title: 'Collabs', to: 'collabs' },
]

Expand Down
Loading