Skip to content

Commit

Permalink
# This is a combination of 27 commits.
Browse files Browse the repository at this point in the history
# This is the 1st commit message:

coll imgs now scaled down + height:100%

coll imgs now scaled down + height:100%

# This is the commit message tqtezos#2:

removed preview text for UI purposes (tqtezos#262)

Removed preview
# This is the commit message tqtezos#3:

update README (tqtezos#268)

PR points to Minter SDK for contracts and updates some of the README
# This is the commit message tqtezos#4:

Carbon savings message on creation of NFT (tqtezos#264)

* added CO2 em. message
* Modified copy
# This is the commit message tqtezos#5:

Add video metadata types to file upload page. Fixes tqtezos#238 (tqtezos#251)


# This is the commit message tqtezos#6:

feat: Update fa2_tzip16_compate_multi_nft_asset.ts with (tqtezos/minter-sdk#62) code

# This is the commit message tqtezos#7:

feat: Update git hash in bootstrap-contracts-config.ts

# This is the commit message tqtezos#8:

Add badge to display network when not on mainnet.

# This is the commit message tqtezos#9:

Add badge to display network when not on mainnet.

# This is the commit message tqtezos#10:

Link contract to explorer GUI. Fixes tqtezos#242

# This is the commit message tqtezos#11:

added OM favicon replacement (tqtezos#283)


# This is the commit message tqtezos#12:

shield auto-updates (tqtezos#284)


# This is the commit message tqtezos#13:

updated shield code

# This is the commit message tqtezos#14:

Make grid responsive (tqtezos#249)


# This is the commit message tqtezos#15:

Adding basic netlify redirect config (tqtezos#290)


# This is the commit message tqtezos#16:

Initial work on marketplace

# This is the commit message tqtezos#17:

fix formatting

# This is the commit message tqtezos#18:

Loading spinner for collections

# This is the commit message tqtezos#19:

Remove "marketplace" header

# This is the commit message tqtezos#20:

Better icons

# This is the commit message tqtezos#21:

Only show active sale items

# This is the commit message tqtezos#22:

Batch "list for sale" transactions. Fixes tqtezos#287

# This is the commit message tqtezos#23:

revert marketplace contract to correct version

# This is the commit message tqtezos#24:

restart bcd api in sandbox on failure

# This is the commit message tqtezos#25:

feat: Update header to reflect new designs

# This is the commit message tqtezos#26:

feat: Move logo to common assets, add responsive header logo

# This is the commit message tqtezos#27:

This should be replace: false, or else the back button will not go back to marketplace
  • Loading branch information
maelswarm committed Apr 1, 2021
1 parent 8431088 commit 430cff4
Show file tree
Hide file tree
Showing 32 changed files with 724 additions and 323 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![OpenMinter header](/docs/assets/minterhead.png)

[![](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE) [![](https://img.shields.io/badge/version-v0.4.2-orange)](https://github.com/tqtezos/minter)
[![](https://img.shields.io/badge/license-MIT-brightgreen)](LICENSE) [![](https://img.shields.io/github/v/release/tqtezos/minter)](https://github.com/tqtezos/minter)

## OpenMinter

Expand All @@ -12,7 +12,7 @@ capabilities to trade them.

### Notice

This software is in beta. At the moment, the smart contracts
This software is in beta. At the moment, the [smart contracts](https://github.com/tqtezos/minter-sdk)
that OpenMinter uses have **not** been formally audited. Please
use this software at your own risk.

Expand Down Expand Up @@ -40,9 +40,9 @@ OpenMinter supports the following networks and software components:
#### 🌐 Mainnet and Edonet
#### 📦 Sandboxed development via [Flextesa][flextesa]
#### 🎨 Multimedia NFTs powered by [TZIP-21](https://tzip.tezosagora.org/proposal/tzip-21/)
#### 👛 Various wallets via [Beacon](https://www.walletbeacon.io/)
#### ⚙️ Smart contracts based on [minter-sdk](https://github.com/tqtezos/minter-sdk)
#### 👛 Wallets compatible with [Beacon](https://www.walletbeacon.io/)
#### 📖 Indexing via [Better Call Dev][bcdhub]
#### ⚙️ The latest [FA2](https://gitlab.com/tzip/tzip/-/blob/master/proposals/tzip-12/tzip-12.md) specification
#### 🚀 [IPFS](https://ipfs.io/) via a local node or [Pinata](https://pinata.cloud/)

The following dependencies are required to run OpenMinter.
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ services:
- mq
ports:
- 42000:14000
restart: on-failure
logging:
options:
max-size: 10m
Expand Down
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"@reduxjs/toolkit": "1.5.0",
"@taquito/beacon-wallet": "8.0.6-beta.0",
"@taquito/signer": "8.0.6-beta.0",
"@taquito/tzip16": "8.0.6-beta.0",
"@taquito/taquito": "8.0.6-beta.0",
"@taquito/tzip16": "8.0.6-beta.0",
"@taquito/tzip12": "8.0.6-beta.0",
"@types/lodash": "4.14.165",
"@types/react": "16.9.12",
"@types/react-dom": "16.9.0",
Expand All @@ -26,18 +27,19 @@
"react-dom": "16.13.1",
"react-dropzone": "11.2.4",
"react-feather": "2.0.9",
"react-icons": "4.2.0",
"react-redux": "7.2.2",
"typescript": "4.1.3",
"wouter": "2.5.1"
},
"devDependencies": {
"@types/async-retry": "1.4.2",
"@types/configstore": "4.0.0",
"@types/jest": "24.0.0",
"@testing-library/jest-dom": "4.2.4",
"@testing-library/react": "9.3.2",
"@testing-library/user-event": "7.1.2",
"@tsed/logger": "5.5.2",
"@types/async-retry": "1.4.2",
"@types/configstore": "4.0.0",
"@types/jest": "24.0.0",
"async-retry": "1.3.1",
"axios": "0.21.1",
"configstore": "5.0.1",
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
11 changes: 7 additions & 4 deletions scripts/bootstrap-contracts-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface BoostrapStorageCallback {
interface BootstrapContractParams {
configKey: string;
contractFilename: string;
contractGitHash: string;
contractAlias: string;
initStorage: BoostrapStorageCallback;
}
Expand Down Expand Up @@ -63,11 +64,11 @@ async function getContractAddress(
}

async function fetchContractCode(
contractFilename: string
contractFilename: string,
contractGitHash: string
): Promise<ContractCodeResponse> {
const rawRepoUrl = 'https://raw.githubusercontent.com/tqtezos/minter-sdk';
const gitHash = '8f67bb8c2abc12b8e6f8e529e1412262972deab3';
const contractCodeUrl = `${rawRepoUrl}/${gitHash}/contracts/bin/${contractFilename}`;
const contractCodeUrl = `${rawRepoUrl}/${contractGitHash}/contracts/bin/${contractFilename}`;
const response = await axios.get(contractCodeUrl);
return { code: response.data, url: contractCodeUrl };
}
Expand Down Expand Up @@ -130,7 +131,7 @@ async function bootstrapContract(
let contract;
try {
const { code, url: contractCodeUrl } = await fetchContractCode(
params.contractFilename
params.contractFilename, params.contractGitHash
);

$log.info(
Expand Down Expand Up @@ -175,6 +176,7 @@ async function bootstrap(env: string) {
configKey: 'contracts.nftFaucet',
contractAlias: 'nftFaucet',
contractFilename: 'fa2_multi_nft_faucet.tz',
contractGitHash: 'aec441412d53653fa0048fee7c12c1eb1365909b',
initStorage: initStorageNftFaucet
});

Expand All @@ -183,6 +185,7 @@ async function bootstrap(env: string) {
configKey: 'contracts.marketplace.fixedPrice.tez',
contractAlias: 'fixedPriceMarketTez',
contractFilename: 'fixed_price_sale_market_tez.tz',
contractGitHash: '8f67bb8c2abc12b8e6f8e529e1412262972deab3',
initStorage: () => new MichelsonMap()
});
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import SplashPage from '../SplashPage';
import CreateNonFungiblePage from '../CreateNonFungiblePage';
import CollectionsCatalog from '../Collections/Catalog';
import CollectionsTokenDetail from '../Collections/TokenDetail';
import MarketplaceCatalog from '../Marketplace/Catalog';
import Header from '../common/Header';
import { Flex } from '@chakra-ui/react';
import Notifications from '../common/Notifications';
Expand Down Expand Up @@ -40,6 +41,9 @@ export default function App() {
<Route path="/collections">
<CollectionsCatalog />
</Route>
<Route path="/marketplace">
<MarketplaceCatalog />
</Route>
<Route path="/collection/:contractAddress/token/:tokenId">
{({ contractAddress, tokenId }) => (
<CollectionsTokenDetail
Expand Down
9 changes: 5 additions & 4 deletions src/components/Collections/Catalog/TokenGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { useLocation } from 'wouter';
import { AspectRatio, Box, Flex, Grid, Image, Text } from '@chakra-ui/react';
import { AspectRatio, Box, Flex, SimpleGrid, Image, Text } from '@chakra-ui/react';
import { Wind, HelpCircle } from 'react-feather';
import { Token, CollectionsState } from '../../../reducer/slices/collections';
import { ipfsUriToGatewayUrl } from '../../../lib/util/ipfs';
Expand Down Expand Up @@ -55,8 +55,9 @@ function TokenImage(props: { src: string }) {
return (
<Image
src={props.src}
objectFit="contain"
objectFit="scale-down"
flex="1"
height="100%"
onError={() => setErrored(true)}
/>
);
Expand Down Expand Up @@ -169,7 +170,7 @@ export default function TokenGrid({ state, walletAddress }: TokenGridProps) {
}

return (
<Grid templateColumns="repeat(4, 1fr)" gap={8} pb={8}>
<SimpleGrid columns={{sm: 1, md: 2, lg: 3, xl: 4}} gap={8} pb={8}>
{tokens.map(token => {
return (
<TokenTile
Expand All @@ -180,6 +181,6 @@ export default function TokenGrid({ state, walletAddress }: TokenGridProps) {
/>
);
})}
</Grid>
</SimpleGrid>
);
}
26 changes: 20 additions & 6 deletions src/components/Collections/Catalog/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import { Box, Flex, Heading, Text } from '@chakra-ui/react';
import { Box, Flex, Heading, Text, Link, Spinner } from '@chakra-ui/react';
import { useLocation } from 'wouter';
import { RefreshCw } from 'react-feather';
import { RefreshCw, ExternalLink } from 'react-feather';
import { MinterButton } from '../../common';
import Sidebar from './Sidebar';
import TokenGrid from './TokenGrid';
Expand Down Expand Up @@ -68,9 +68,14 @@ export default function Catalog() {
<Flex w="100%" pb={6} justify="space-between" align="center">
<Flex flexDir="column">
<Heading size="lg">{collection.metadata.name || ''}</Heading>
<Text fontFamily="mono" color="brand.lightGray">
{collection.address}
</Text>
<Flex align="center">
<Text fontFamily="mono" color="brand.lightGray">
{collection.address}
</Text>
<Link href={system.config.bcd.gui+"/"+collection.address} color="brand.darkGray" isExternal ml={2}>
<ExternalLink size={16} />
</Link>
</Flex>
</Flex>
<MinterButton
variant="primaryActionInverted"
Expand All @@ -87,7 +92,16 @@ export default function Catalog() {
<Text ml={2}>Refresh</Text>
</MinterButton>
</Flex>
<TokenGrid state={state} walletAddress={system.tzPublicKey} />
{!collection.loaded ? (
<Flex flexDir="column" align="center" flex="1" pt={20}>
<Spinner size="xl" mb={6} color="gray.300" />
<Heading size="lg" textAlign="center" color="gray.500">
Loading...
</Heading>
</Flex>
) : (
<TokenGrid state={state} walletAddress={system.tzPublicKey} />
)}
</Flex>
</Flex>
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/Collections/TokenDetail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ function TokenImage(props: { src: string }) {
return (
<Image
src={props.src}
objectFit="contain"
objectFit="scale-down"
flex="1"
height="100%"
onError={() => setErrored(true)}
/>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreateNonFungiblePage/FileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
export function FilePreview({ file }: { file: SelectedFile }) {
const dispatch = useDispatch();
if (/^image\/.*/.test(file.type)) {
return <Image src={file.objectUrl} width="100%" height="100%" objectFit='contain' />;
return <Image src={file.objectUrl} width="100%" height="100%" objectFit="scale-down" />;
}
if (/^video\/.*/.test(file.type)) {
const canvasRef = createRef<HTMLCanvasElement>();
Expand Down Expand Up @@ -87,7 +87,7 @@ export default function FileUpload() {
textAlign="center"
pb={4}
>
JPG, PNG, GIF, WEBP, SVG. Max size 30mb
JPG, PNG, GIF, WEBP, SVG, MP4, WebM, Ogg. Max size 30mb
</Text>
<Flex
borderStyle="dashed"
Expand Down
4 changes: 2 additions & 2 deletions src/components/CreateNonFungiblePage/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function Preview() {
{selectedFile ? <FilePreview file={selectedFile} /> : null}
</Flex>
<Heading size="md" color={name ? 'black' : 'gray.200'} px={8} py={6}>
{name ? name : 'Asset name...'}
{name ? name : ''}
</Heading>
<Divider borderColor="brand.lightBlue" opacity="1" />
<Text
Expand All @@ -36,7 +36,7 @@ export default function Preview() {
color={description ? 'black' : 'gray.200'}
fontFamily="mono"
>
{description ? description : 'Asset description...'}
{description ? description : ''}
</Text>
<Divider borderColor="brand.lightBlue" opacity="1" />
{/* TODO: Render metadata in preview */}
Expand Down
4 changes: 4 additions & 0 deletions src/components/CreateNonFungiblePage/StatusModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function Content({ status, onClose, onRetry, onCancel }: StatusModalProps) {
<Heading size="lg" textAlign="center" color="gray.500">
Creating token...
</Heading>
<br/>
<Text size="xs" textAlign="center" color="gray.500">
<span role="img" aria-label="lightbulb">🌱</span> Minting on Tezos produces 1,500,000 times less CO2 emissions than Ethereum.
</Text>
</Flex>
);
}
Expand Down
49 changes: 49 additions & 0 deletions src/components/Marketplace/Catalog/FeaturedToken.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import React from 'react';
import { Token } from '../../../reducer/slices/collections';
import { useLocation } from 'wouter';
import { ipfsUriToGatewayUrl } from '../../../lib/util/ipfs';
import { AspectRatio, Box, Container, Flex, Spacer, Text, Heading, Stack } from '@chakra-ui/react';
import { MinterButton } from '../../common';
import { TokenMedia } from '../../common/TokenMedia';

interface FeaturedTokenProps extends Token {
network: string;
}

export default function FeaturedToken(props: FeaturedTokenProps) {
const [, setLocation] = useLocation();
return (
<Container maxW="65em" py={10}>
<Stack direction={{sm: "column", md: "row"}} spacing="24px" mb={10}>
<Box w="400px" h="266px">
<AspectRatio maxW="400px" maxH="266px" ratio={2 / 3}>
<TokenMedia
src={ipfsUriToGatewayUrl(props.network, props.artifactUri)}
/>
</AspectRatio>
</Box>
<Box>
<Flex flexDir="column" h="100%" w="100%">
<Heading size="md" mt={4}>{props.title}</Heading>
<Heading size="sm" my={4} color="brand.darkGray">Seller: {props.sale?.seller}</Heading>
<Text fontSize="sm" fontWeight="600" color="gray.500">{props.description}</Text>
<Spacer />
<Text fontSize="md">Current Price: <Text as="span" fontWeight="600">{props.sale?.price}</Text></Text>
<MinterButton
size="md"
variant="primaryAction"
w="150px"
my={4}
onClick={e => {
e.preventDefault();
setLocation(`/collection/${props.address}/token/${props.id}`, { replace: false });
}}
>
<Text>View</Text>
</MinterButton>
</Flex>
</Box>
</Stack>
</Container>
);
}
67 changes: 67 additions & 0 deletions src/components/Marketplace/Catalog/TokenCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import { Token } from '../../../reducer/slices/collections';
import { useLocation } from 'wouter';
import { ipfsUriToGatewayUrl } from '../../../lib/util/ipfs';
import { AspectRatio, Box, Flex, Text, Heading } from '@chakra-ui/react';
import { TokenMedia } from '../../common/TokenMedia';

interface TokenCardProps extends Token {
network: string;
}

export default function TokenCard(props: TokenCardProps) {
const [, setLocation] = useLocation();
return (
<Flex
flexDir="column"
ratio={1}
w="100%"
bg="white"
border="1px solid"
borderColor="brand.lightBlue"
borderRadius="3px"
overflow="hidden"
boxShadow="0px 0px 0px 4px rgba(15, 97, 255, 0)"
transition="all linear 50ms"
_hover={{
cursor: 'pointer',
boxShadow: '0px 0px 0px 4px rgba(15, 97, 255, 0.1)'
}}
onClick={() =>
setLocation(`/collection/${props.address}/token/${props.id}`)
}
>
<AspectRatio ratio={3 / 2}>
<Box>
<TokenMedia
src={ipfsUriToGatewayUrl(props.network, props.artifactUri)}
/>
</Box>
</AspectRatio>
<Flex
width="100%"
px={4}
py={4}
bg="white"
borderTop="1px solid"
borderColor="brand.lightBlue"
flexDir="column"
>
<Heading size="sm">{props.title}</Heading>
<Text fontSize="sm">Seller: {props.sale?.seller.substr(0, 5)}...{props.sale?.seller.substr(-5)}</Text>
</Flex>
<Flex
px={2}
py={4}
mx={2}
bg="white"
borderTop="1px solid"
borderColor="brand.lightGray"
justify="space-between"
>
<Text fontSize="md">Current Price</Text>
<Text fontSize="md" fontWeight="600">{props.sale?.price}</Text>
</Flex>
</Flex>
);
}
Loading

0 comments on commit 430cff4

Please sign in to comment.