Skip to content

Commit

Permalink
feat: add flowty link
Browse files Browse the repository at this point in the history
  • Loading branch information
LanfordCai committed Oct 21, 2023
1 parent 226105d commit adbb8b1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
4 changes: 4 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ export const getFlowverseLink = (contractName) => {
return `https://nft.flowverse.co/marketplace/${contractName}`
}

export const getFlowtyLink = (contractAddress, contractName) => {
return `https://www.flowty.io/collection/${contractAddress}/${contractName}`
}

export const formatTypeID = (typeID) => {
// e.g. A.631e88ae7f1d7c20.NonFungibleToken .CollectionPublic
const contract = getContract(typeID)
Expand Down
13 changes: 12 additions & 1 deletion pages/account/[account]/collection/[collection]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import NFTListView from "../../../../../components/common/NFTListView"
import Spinner from "../../../../../components/common/Spinner"
import { bulkGetNftCatalog, getStoredItems } from "../../../../../flow/scripts"
import { basicNotificationContentState, nftCatalogState, showBasicNotificationState, showNftBulkTransferPreviewState, showNftBulkTransferState, transactionInProgressState } from "../../../../../lib/atoms"
import { classNames, collectionsWithCatalogInfo, collectionsWithDisplayInfo, collectionsWithExtraData, getContractLink, getFlowverseLink, getImageSrcFromMetadataViewsFile, isValidFlowAddress } from "../../../../../lib/utils"
import { classNames, collectionsWithCatalogInfo, collectionsWithDisplayInfo, collectionsWithExtraData, getContractLink, getFlowverseLink, getFlowtyLink, getImageSrcFromMetadataViewsFile, isValidFlowAddress } from "../../../../../lib/utils"
import publicConfig from "../../../../../publicConfig"
import Custom404 from "../../404"
import NftBulkTransferModal from "../../../../../components/collection/NftBulkTransferModal"
Expand Down Expand Up @@ -279,6 +279,17 @@ export default function CollectionDetail(props) {
{getContractInfoView()}
<div className="px-1 py-2 w-[1070px]">{description}</div>
<div className="mt-2 mb-4 flex gap-x-2 items-center">
{
collection && collection.contractName && collection.contractAddress ?
<a href={getFlowtyLink(collection.contractAddress, collection.contractName)}
target="_blank"
rel="noopener noreferrer"
className="shrink-0">
<div className="flex items-center rounded-full ring-1 ring-drizzle px-2 py-1 text-xs sm:text-sm text-black">
<Image className="rounded-full" src="/flowty.jpg" alt="" width={20} height={20} />&nbsp;Trade on Flowty
</div>
</a> : null
}
{
collection && collection.contractName ?
<a href={getFlowverseLink(collection.contractName)}
Expand Down
18 changes: 13 additions & 5 deletions pages/account/[account]/collection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function Collection(props) {
useEffect(() => {
if (nftCatalog && collections && collections.length > 0 && !collections[0].addedCatalogInfo) {
const newCollections = collectionsWithCatalogInfo(collections, nftCatalog)
setCollections(newCollections)
setCollections(newCollections)
}
}, [nftCatalog, collections])

Expand Down Expand Up @@ -141,24 +141,32 @@ export default function Collection(props) {
</Switch>
</div>
</div>
<div className="hidden sm:flex sm:gap-x-1 sm:items-center px-1 overflow-hidden">
{/* <label className={`item-start hidden sm:block cursor-pointer text-black bg-drizzle hover:bg-drizzle-dark px-3 py-2 text-sm rounded-2xl font-semibold shrink-0`}>
<div className="hidden sm:flex sm:gap-x-2 sm:items-center px-1 overflow-hidden">
{/* <label className={`item-start hidden sm:block cursor-pointer text-black bg-drizzle hover:bg-drizzle-dark px-3 py-2 text-sm rounded-2xl font-semibold shrink-0`}>
<a href={`${publicConfig.drizzleURL}`}
target="_blank"
rel="noopener noreferrer"
>
Create raffle
</a>
</label> */}
<a href={`http://nft.flowverse.co/marketplace`}
<a href={`https://www.flowty.io/marketplace`}
target="_blank"
rel="noopener noreferrer"
className="py-2">
<div className="flex items-center rounded-full ring-1 ring-drizzle px-2 py-1 text-xs sm:text-sm text-black">
<Image className="rounded-full" src="/flowty.jpg" alt="" width={20} height={20} />&nbsp;Trade on Flowty
</div>
</a>
<a href={`http://nft.flowverse.co/marketplace`}
target="_blank"
rel="noopener noreferrer"
className="py-2">
<div className="flex items-center rounded-full ring-1 ring-drizzle px-2 py-1 text-xs sm:text-sm text-black">
<Image src="/flowverse.png" alt="" width={20} height={20} />&nbsp;Trade on Flowverse
</div>
</a>
</div>
</div>
</div>
<div className="px-2 py-2 overflow-x-auto max-h-screen w-full">
<div className="inline-block min-w-full">
Expand Down
Binary file added public/flowty.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

1 comment on commit adbb8b1

@vercel
Copy link

@vercel vercel bot commented on adbb8b1 Oct 21, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.