Skip to content

Commit

Permalink
Merge branch 'main' of github.com:NFTEarth/nft-marketplace
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuzaki01 committed Aug 5, 2023
2 parents 9bd4087 + 98fa448 commit bf12d0b
Show file tree
Hide file tree
Showing 28 changed files with 121 additions and 208 deletions.
Empty file removed .env.development
Empty file.
Empty file removed .env.production
Empty file.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
/build

# misc
.idea
.DS_Store
*.pem

Expand Down
11 changes: 11 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: yarn install && yarn run build
command: yarn run start


11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<h3 align="center">Reservoir Market v2</h3>
<h3 align="center">NFTEarth Marketplace v2</h3>
<p align="center">
An open source NFT marketplace built on Reservoir.

Open-source NFT marketplace built on top of Reservoir.

<!-- ABOUT THE PROJECT -->
Marketplace, Launchpad, and NFT-applications - all at NFTEarth.

## About The Project

![(500 × 500 px)](https://github.com/NFTEarth/nft-marketplace/assets/29180454/27aeaddc-8507-4c5c-88c8-15d2fa14f2e5)



Reservoir Market v2 is an open source marketplace built with Reservoir APIs that enables access to instant liquidity aggregated from major marketplace. We encourage developers to use this project as a reference for their own implementation or even fork the project and make their own meaningful changes. The project is lightly configurable refer to the configuration variables below. If you're looking for a no-code solution check out our [v1 marketplace](https://github.com/reservoirprotocol/marketplace-v1).

<p align="right">(<a href="#top">back to top</a>)</p>
Expand Down
16 changes: 10 additions & 6 deletions components/AnalyticsProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { FC, ReactElement, useEffect } from 'react'
import { useAccount } from 'wagmi'
import { datadogRum } from '@datadog/browser-rum'
import posthog from 'posthog-js'

const env = process.env.NODE_ENV
const ddApplicationId = process.env.NEXT_PUBLIC_DATADOG_APPLICATION_ID
Expand All @@ -12,7 +11,7 @@ type Props = {
children: ReactElement
}

export const initializeAnalytics = () => {
export const initializeAnalytics = async () => {
if (typeof window !== 'undefined' && !datadogRum.getInitConfiguration()) {
if (ddApplicationId && ddClientToken) {
datadogRum.init({
Expand All @@ -34,8 +33,9 @@ export const initializeAnalytics = () => {
}
}

if (typeof window !== 'undefined' && posthogClientToken) {
posthog.init(posthogClientToken, {
if (typeof window !== 'undefined' && posthogClientToken !== '') {
const posthog = (await import('posthog-js')).default
posthog.init(posthogClientToken || '', {
api_host: 'https://app.posthog.com',
disable_session_recording: true,
mask_all_text: false,
Expand All @@ -59,8 +59,12 @@ const AnalyticsProvider: FC<Props> = ({ children }) => {
datadogRum.setUser({
id: address,
})
if (posthogClientToken) {
posthog.identify(address)

if (posthogClientToken !== '') {
(async () => {
const posthog = (await import('posthog-js')).default
posthog.identify(address)
})
}
}
}, [accountData])
Expand Down
16 changes: 8 additions & 8 deletions components/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ type Props = {
* @param description - The description of the page.
*/
export const Head: FC<Props> = ({
ogImage = 'https://explorer.reservoir.tools/og-image.png',
title = 'Reservoir | Multi-Chain NFT Explorer',
description = 'Reservoir Multi-Chain NFT Explorer is an open source NFT explorer built with Reservoir.',
ogImage = 'https://i.ibb.co/7Gd9bTY/NFTE-Icon-1.png',
title = 'NFTEarth | Omnichain NFT Hub',
description = 'NFTEarth is an open-source NFT protocol built on Reservoir.',
}) => {
return (
<NextHead>
Expand All @@ -30,23 +30,23 @@ export const Head: FC<Props> = ({
<meta name="description" content={description} />

{/* Twitter */}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@reservoir0x" />
<meta name="twitter:card" content="NFTEarth" />
<meta name="twitter:site" content="@NFTEarth_L2" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={ogImage} />

{/* Open Graph */}
<meta property="og:type" content="website" />
<meta property="og:type" content="https://nftearth.exchange" />
<meta property="og:determiner" content="the" />
<meta property="og:locale" content="en" />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={ogImage} />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:type" content="https://i.ibb.co/7Gd9bTY/NFTE-Icon-1.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Reservoir NFT Explorer Banner" />
<meta property="og:image:alt" content="NFTEarth" />
</NextHead>
)
}
25 changes: 16 additions & 9 deletions components/collections/TokenCard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { faCheck, faCircleExclamation } from '@fortawesome/free-solid-svg-icons'
import { faCheck, faBolt, faCircleExclamation } from '@fortawesome/free-solid-svg-icons'
import { useMediaQuery } from 'react-responsive'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import {
extractMediaType,
Expand Down Expand Up @@ -44,12 +45,13 @@ export default ({
tokenCount,
}: TokenCardProps) => {
const { addToast } = useContext(ToastContext)
const isSmallDevice = useMediaQuery({ maxWidth: 900 })
const mediaType = extractMediaType(token?.token)
const showPreview =
mediaType === 'other' || mediaType === 'html' || mediaType === null
const { routePrefix, proxyApi } = useMarketplaceChain()
const tokenIsInCart = token && token?.isInCart
const isOwner = token?.token?.owner?.toLowerCase() !== address?.toLowerCase()
const isNotOwner = token?.token?.owner?.toLowerCase() !== address?.toLowerCase()

const is1155 = token?.token?.kind === 'erc1155'

Expand Down Expand Up @@ -190,7 +192,7 @@ export default ({
href={`/${routePrefix}/asset/${token?.token?.contract}:${token?.token?.tokenId}`}
>
<Flex
css={{ p: '$4', minHeight: 132, cursor: 'pointer' }}
css={{ p: '$4', cursor: 'pointer', '@lg': { minHeight: 132 } }}
direction="column"
>
<Flex css={{ mb: '$4' }} align="center" justify="between">
Expand Down Expand Up @@ -321,16 +323,21 @@ export default ({
) : null}
</Flex>
</Link>
{isOwner && token?.market?.floorAsk?.price?.amount ? (
{isNotOwner && token?.market?.floorAsk?.price?.amount ? (
<Flex
className="token-button-container"
css={{
width: '100%',
transition: 'bottom 0.25s ease-in-out',
position: 'absolute',
bottom: -44,
left: 0,
right: 0,
'@sm': {
position: 'relative'
},
'@lg': {
position: 'absolute',
bottom: -44,
left: 0,
right: 0,
},
gap: 1,
}}
>
Expand All @@ -345,7 +352,7 @@ export default ({
buttonProps={{
corners: 'square',
}}
buttonChildren="Buy Now"
buttonChildren={isSmallDevice ? <FontAwesomeIcon icon={faBolt} /> : "Buy Now"}
/>
{addToCartEnabled ? (
<AddToCart
Expand Down
4 changes: 2 additions & 2 deletions components/common/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ export const Modal = forwardRef<ElementRef<typeof Dialog>, Props>(
borderBottomLeftRadius: '$borderRadius',
}}
>
<Anchor href="https://reservoir.tools/" target="_blank">
<Anchor href="https://nftearth.exchange/" target="_blank">
<Text
style="body3"
css={{ display: 'inline-flex', alignItems: 'center', gap: 4 }}
>
Powered by <Logo />
Powered by NFTEarth
</Text>
</Anchor>
</Flex>
Expand Down
33 changes: 13 additions & 20 deletions components/home/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,27 @@ const SectionLink: FC<SectionLinkProps> = ({ name, href }) => (
const developerSectionLinks = [
{
name: 'Docs',
href: 'https://docs.reservoir.tools/docs',
href: 'https://docs.nftearth.exchange',
},
{
name: 'API Reference',
href: 'https://docs.reservoir.tools/reference/overview',
},
{
name: 'Github',
href: 'https://github.com/reservoirprotocol',
},
{
name: 'Testnets',
href: 'https://testnets.reservoir.tools',
name: 'GitHub',
href: 'https://github.com/NFTEarth',
},

]

const companySectionLinks = [
{
name: 'Jobs',
href: 'https://jobs.ashbyhq.com/reservoir',
name: 'Contact: [email protected]',
href: 'https://nftearth.exhange',
},
{
name: 'Terms of Use',
href: 'https://reservoir.tools/terms',
name: 'Terms',
href: 'https://docs.nftearth.exchange/resources-and-features/terms-of-use',
},
{
name: 'Privacy Policy',
href: 'https://reservoir.tools/privacy',
name: 'Privacy',
href: 'https://docs.nftearth.exchange/resources-and-features/privacy-policy',
},
]

Expand Down Expand Up @@ -89,7 +82,7 @@ export const Footer = () => {
))}
</Flex>
<Flex direction="column">
<SectionTitle title="Company" />
<SectionTitle title="Protocol" />
{companySectionLinks.map((props) => (
<SectionLink key={props.name} {...props} />
))}
Expand All @@ -99,12 +92,12 @@ export const Footer = () => {
direction="column"
css={{ alignItems: 'flex-start', '@bp600': { alignItems: 'flex-end' } }}
>
<SectionTitle title="Join Reservoir Community" />
<SectionTitle title="Join the NFTEarth Community" />
<Flex css={{ gap: '$4', mt: 16 }}>
<a
target="_blank"
rel="noopener noreferrer"
href="https://twitter.com/reservoir0x"
href="https://twitter.com/NFTEarth_L2"
>
<Button size="xs" color="gray3">
<FontAwesomeIcon icon={faTwitter} width={14} height={14} />
Expand Down
22 changes: 21 additions & 1 deletion components/navbar/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
FormatCurrency,
Text,
} from 'components/primitives'
import { mainnet, polygon, optimism } from 'wagmi/chains'
import { mainnet, polygon, optimism, arbitrum } from 'wagmi/chains'
import { useAccount, useContractReads, erc20ABI, useBalance } from 'wagmi'
import { useMemo, useState } from 'react'
import { zeroAddress, formatUnits } from 'viem'
Expand Down Expand Up @@ -66,6 +66,26 @@ const currencies = [
},
coinGeckoId: 'weth',
},
{
address: '0x912ce59144191c1204e64559fe8253a0e49e6548',
symbol: 'ARB',
decimals: arbitrum.nativeCurrency.decimals,
chain: {
id: arbitrum.id,
name: arbitrum.name,
},
coinGeckoId: 'arbitrum',
},
{
address: '0x51b902f19a56f0c8e409a34a215ad2673edf3284',
symbol: 'NFTE',
decimals: arbitrum.nativeCurrency.decimals,
chain: {
id: arbitrum.id,
name: arbitrum.name,
},
coinGeckoId: 'arbitrum',
},
]

type EnhancedCurrency = (typeof currencies)[0] & {
Expand Down
32 changes: 16 additions & 16 deletions components/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ const Navbar = () => {
<Link href={`/${routePrefix}`}>
<Box css={{ width: 34, cursor: 'pointer' }}>
<Image
src="/reservoirLogo.svg"
width={34}
src="/res2.png"
width={39}
height={39}
alt="Reservoir"
alt="NFTEarth"
/>
</Box>
</Link>
Expand Down Expand Up @@ -102,40 +102,40 @@ const Navbar = () => {
<Box css={{ width: 112, cursor: 'pointer' }}>
{theme == 'dark' ? (
<Image
src="/reservoirMarketLogo.svg"
width={112}
height={36}
alt="Reservoir"
src="/res2.png"
width={50}
height={50}
alt="NFTEarth"
/>
) : (
<Image
src="/reservoirMarketLogoLight.svg"
width={112}
height={36}
alt="Reservoir"
src="/res2.png"
width={50}
height={50}
alt="NFTEarth"
/>
)}
</Box>
</Link>
<Box css={{ flex: 1, px: '$5', maxWidth: 600 }}>
<GlobalSearch
ref={searchRef}
placeholder="Search collections and addresses"
placeholder="Search for NFTs and collections"
containerCss={{ width: '100%' }}
key={router.asPath}
/>
</Box>
<Flex align="center" css={{ gap: '$5', mr: '$5' }}>
<Link href={`/${routePrefix}/collection-rankings`}>
<NavItem active={router.pathname.includes('collection-rankings')}>
Collections
Explore
</NavItem>
</Link>
<Link href="/portfolio">
<NavItem active={router.pathname == '/portfolio'}>Sell</NavItem>
<NavItem active={router.pathname == '/portfolio'}>Trade</NavItem>
</Link>
<Link href="https://docs.reservoir.tools/docs">
<NavItem active={false}>Docs</NavItem>
<Link href="https://www.sushi.com/pool/42161:0xd2aaa8fc5c39dbe68344bc42d4513ea344e5d696">
<NavItem active={false}>SushiSwap Farming Rewards</NavItem>
</Link>
</Flex>
</Flex>
Expand Down
2 changes: 1 addition & 1 deletion components/primitives/FormatCurrency.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type Props = {

const FormatCurrency: FC<ComponentPropsWithoutRef<typeof Text> & Props> = ({
amount,
maximumFractionDigits = 2,
maximumFractionDigits = 4,
currency = 'USD',
...props
}) => {
Expand Down
2 changes: 1 addition & 1 deletion pages/[chain]/collection/[contract].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ const CollectionPage: NextPage<Props> = ({ id, ssr }) => {
gap: '$4',
pb: '$6',
gridTemplateColumns:
'repeat(auto-fill, minmax(200px, 1fr))',
'repeat(auto-fill, minmax(150px, 1fr))',
'@md': {
gridTemplateColumns:
'repeat(auto-fill, minmax(240px, 1fr))',
Expand Down
Loading

0 comments on commit bf12d0b

Please sign in to comment.