Skip to content

Commit

Permalink
Add create collection countdown (#22)
Browse files Browse the repository at this point in the history
* Add create collection countdown

* Fix styles

* Fix countdown display for admins and fix stale last collection
  • Loading branch information
nikitayutanov authored Feb 29, 2024
1 parent 904dd14 commit d181f80
Show file tree
Hide file tree
Showing 12 changed files with 230 additions and 38 deletions.
2 changes: 2 additions & 0 deletions frontend/src/context/marketplace/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const MARKETPLACE_QUERY = graphql(`
minimumValueForTrade
royaltyToMarketplaceForMint
royaltyToMarketplaceForTrade
timeBetweenCreateCollections
}
admins
}
}
`);
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/context/marketplace/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ type Marketplace = {
minimumValueForTrade: string;
royaltyToMarketplaceForMint: number;
royaltyToMarketplaceForTrade: number;
timeBetweenCreateCollections: string;
};
admins: string[];
};

type Value = {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/features/marketplace/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function getMilliseconds(value: number, unit: 'second' | 'minute' | 'hour' | 'day') {
// TODO: global constants
const MULTIPLIER = { MS: 1000, S: 60, M: 60, H: 24 };

const UNIT_MULTIPLIER = {
Expand Down
9 changes: 7 additions & 2 deletions frontend/src/graphql/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
* Therefore it is highly recommended to use the babel or swc plugin for production.
*/
const documents = {
"\n query MarketplaceQuery {\n marketplaceById(id: \"1\") {\n address\n collectionTypes {\n description\n metaUrl\n type\n }\n metadata\n config {\n feePerUploadedFile\n minimumValueForTrade\n royaltyToMarketplaceForMint\n royaltyToMarketplaceForTrade\n }\n }\n }\n": types.MarketplaceQueryDocument,
"\n query MarketplaceQuery {\n marketplaceById(id: \"1\") {\n address\n collectionTypes {\n description\n metaUrl\n type\n }\n metadata\n config {\n feePerUploadedFile\n minimumValueForTrade\n royaltyToMarketplaceForMint\n royaltyToMarketplaceForTrade\n timeBetweenCreateCollections\n }\n admins\n }\n }\n": types.MarketplaceQueryDocument,
"\n subscription CollectionQuery($id: String!) {\n collectionById(id: $id) {\n id\n name\n description\n collectionBanner\n collectionLogo\n admin\n tokensLimit\n permissionToMint\n userMintLimit\n paymentForMint\n transferable\n sellable\n\n nfts {\n id\n idInCollection\n name\n mediaUrl\n owner\n mintedBy\n\n sales(where: { status_eq: \"open\" }) {\n price\n }\n\n auctions(where: { status_eq: \"open\" }) {\n minPrice\n lastPrice\n endTimestamp\n }\n }\n\n additionalLinks {\n discord\n externalUrl\n medium\n xcom\n telegram\n }\n }\n }\n": types.CollectionQueryDocument,
"\n query LastCreatedCollectionQuery($admin: String!) {\n collections(where: { admin_eq: $admin }, orderBy: createdAt_DESC, limit: 1) {\n createdAt\n }\n }\n": types.LastCreatedCollectionQueryDocument,
"\n subscription CollectionsQuery {\n collections {\n id\n name\n description\n collectionBanner\n collectionLogo\n admin\n tokensLimit\n\n nfts {\n id\n mediaUrl\n }\n }\n }\n": types.CollectionsQueryDocument,
"\n subscription NFTsQuery {\n nfts {\n id\n idInCollection\n name\n mediaUrl\n owner\n\n collection {\n id\n name\n transferable\n sellable\n }\n\n sales(where: { status_eq: \"open\" }) {\n price\n }\n\n auctions(where: { status_eq: \"open\" }) {\n minPrice\n lastPrice\n endTimestamp\n }\n }\n }\n": types.NfTsQueryDocument,
"\n subscription NFTQuery($id: String!) {\n nftById(id: $id) {\n id\n idInCollection\n name\n description\n mediaUrl\n owner\n createdAt\n\n collection {\n id\n name\n royalty\n sellable\n transferable\n\n type {\n type\n }\n }\n\n sales(where: { status_eq: \"open\" }) {\n price\n }\n\n auctions(where: { status_eq: \"open\" }) {\n minPrice\n lastPrice\n endTimestamp\n }\n }\n }\n": types.NftQueryDocument,
Expand All @@ -37,11 +38,15 @@ export function graphql(source: string): unknown;
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n query MarketplaceQuery {\n marketplaceById(id: \"1\") {\n address\n collectionTypes {\n description\n metaUrl\n type\n }\n metadata\n config {\n feePerUploadedFile\n minimumValueForTrade\n royaltyToMarketplaceForMint\n royaltyToMarketplaceForTrade\n }\n }\n }\n"): (typeof documents)["\n query MarketplaceQuery {\n marketplaceById(id: \"1\") {\n address\n collectionTypes {\n description\n metaUrl\n type\n }\n metadata\n config {\n feePerUploadedFile\n minimumValueForTrade\n royaltyToMarketplaceForMint\n royaltyToMarketplaceForTrade\n }\n }\n }\n"];
export function graphql(source: "\n query MarketplaceQuery {\n marketplaceById(id: \"1\") {\n address\n collectionTypes {\n description\n metaUrl\n type\n }\n metadata\n config {\n feePerUploadedFile\n minimumValueForTrade\n royaltyToMarketplaceForMint\n royaltyToMarketplaceForTrade\n timeBetweenCreateCollections\n }\n admins\n }\n }\n"): (typeof documents)["\n query MarketplaceQuery {\n marketplaceById(id: \"1\") {\n address\n collectionTypes {\n description\n metaUrl\n type\n }\n metadata\n config {\n feePerUploadedFile\n minimumValueForTrade\n royaltyToMarketplaceForMint\n royaltyToMarketplaceForTrade\n timeBetweenCreateCollections\n }\n admins\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n subscription CollectionQuery($id: String!) {\n collectionById(id: $id) {\n id\n name\n description\n collectionBanner\n collectionLogo\n admin\n tokensLimit\n permissionToMint\n userMintLimit\n paymentForMint\n transferable\n sellable\n\n nfts {\n id\n idInCollection\n name\n mediaUrl\n owner\n mintedBy\n\n sales(where: { status_eq: \"open\" }) {\n price\n }\n\n auctions(where: { status_eq: \"open\" }) {\n minPrice\n lastPrice\n endTimestamp\n }\n }\n\n additionalLinks {\n discord\n externalUrl\n medium\n xcom\n telegram\n }\n }\n }\n"): (typeof documents)["\n subscription CollectionQuery($id: String!) {\n collectionById(id: $id) {\n id\n name\n description\n collectionBanner\n collectionLogo\n admin\n tokensLimit\n permissionToMint\n userMintLimit\n paymentForMint\n transferable\n sellable\n\n nfts {\n id\n idInCollection\n name\n mediaUrl\n owner\n mintedBy\n\n sales(where: { status_eq: \"open\" }) {\n price\n }\n\n auctions(where: { status_eq: \"open\" }) {\n minPrice\n lastPrice\n endTimestamp\n }\n }\n\n additionalLinks {\n discord\n externalUrl\n medium\n xcom\n telegram\n }\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
export function graphql(source: "\n query LastCreatedCollectionQuery($admin: String!) {\n collections(where: { admin_eq: $admin }, orderBy: createdAt_DESC, limit: 1) {\n createdAt\n }\n }\n"): (typeof documents)["\n query LastCreatedCollectionQuery($admin: String!) {\n collections(where: { admin_eq: $admin }, orderBy: createdAt_DESC, limit: 1) {\n createdAt\n }\n }\n"];
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
Loading

0 comments on commit d181f80

Please sign in to comment.