Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit 9f8b418

Browse files
lambdahandsobstropolosjacobarluckmycodecraftingw4ll3
authored
v0.5.0-beta (#296)
* removed preview text for UI purposes (#262) Removed preview * update README (#268) PR points to Minter SDK for contracts and updates some of the README * Carbon savings message on creation of NFT (#264) * added CO2 em. message * Modified copy * Add video metadata types to file upload page. Fixes #238 (#251) * feat: Update fa2_tzip16_compate_multi_nft_asset.ts with (tqtezos/minter-sdk#62) code * feat: Update git hash in bootstrap-contracts-config.ts * Add badge to display network when not on mainnet. * Add badge to display network when not on mainnet. * Link contract to explorer GUI. Fixes #242 * Initial work on marketplace * fix formatting * Loading spinner for collections * Remove "marketplace" header * Better icons * Only show active sale items * added OM favicon replacement (#283) * shield auto-updates (#284) * updated shield code * Make grid responsive (#249) * Batch "list for sale" transactions. Fixes #287 * feat: Update header to reflect new designs * feat: Move logo to common assets, add responsive header logo * Adding basic netlify redirect config (#290) * revert marketplace contract to correct version * restart bcd api in sandbox on failure * This should be replace: false, or else the back button will not go back to marketplace * v0.4.3 (#278) * removed preview text for UI purposes (#262) * update README (#268) PR points to Minter SDK for contracts and updates some of the README * Carbon savings message on creation of NFT (#264) * Add video metadata types to file upload page. Fixes #238 (#251) * feat: Update fa2_tzip16_compate_multi_nft_asset.ts with (tqtezos/minter-sdk#62) code * feat: Update git hash in bootstrap-contracts-config.ts * Add type to Nft metadata accordingly to TZIP-21 * Reskin asset detail page Changes appointed in the PR * Allow the addition to root level of metadata * Change sell button to be seen only by the owner * Add custom scrollbar * Optimized for big images * Add zoom feature * Zoom * remove description text for resp. (#291) * Add mobile navigation and collections dropdown (#292) * feat: Add mobile navigation * feat: Add collections dropdown * fix: Cleanup responsive featured marketplace token styles * fix: Remove unused variables * fix: Don't show certain desktop nav items when wallet disconnected * feat: Show connect wallet in settings dropdown if disconnected * Fix zoom * Aligned div * Fix mobile fullscreen * spelling error fix Co-authored-by: Gregory Rocco <gregoryrocco1226@gmail.com> Co-authored-by: jacobarluck <jacobarluck@users.noreply.github.com> Co-authored-by: Joshua Dechant <josh@codecrafting.org> Co-authored-by: Gregório Granado Magalhães <greg.magalhaes@gmail.com>
1 parent 53ddff2 commit 9f8b418

34 files changed

+1403
-322
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![OpenMinter header](/docs/assets/minterhead.png)
22

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

55
## OpenMinter
66

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ services:
1818
- mq
1919
ports:
2020
- 42000:14000
21+
restart: on-failure
2122
logging:
2223
options:
2324
max-size: 10m

docs/20200716_InitialOutline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ will be an element to also explore in future iterations.
6161
- Simple name
6262
- Description
6363
- Symbol
64-
- General key-value pairs
64+
- Attributes (General key-value pairs)
6565
- URL (IPFS image)
6666
- Contract with standard FA2 entry points
6767
- Backend

netlify.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[[redirects]]
2+
from = "/*"
3+
to = "/index.html"
4+
status = 200

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
"@reduxjs/toolkit": "1.5.0",
1111
"@taquito/beacon-wallet": "8.0.6-beta.0",
1212
"@taquito/signer": "8.0.6-beta.0",
13-
"@taquito/tzip16": "8.0.6-beta.0",
1413
"@taquito/taquito": "8.0.6-beta.0",
14+
"@taquito/tzip16": "8.0.6-beta.0",
15+
"@taquito/tzip12": "8.0.6-beta.0",
1516
"@types/lodash": "4.14.165",
1617
"@types/react": "16.9.12",
1718
"@types/react-dom": "16.9.0",
@@ -26,18 +27,19 @@
2627
"react-dom": "16.13.1",
2728
"react-dropzone": "11.2.4",
2829
"react-feather": "2.0.9",
30+
"react-icons": "4.2.0",
2931
"react-redux": "7.2.2",
3032
"typescript": "4.1.3",
3133
"wouter": "2.5.1"
3234
},
3335
"devDependencies": {
34-
"@types/async-retry": "1.4.2",
35-
"@types/configstore": "4.0.0",
36-
"@types/jest": "24.0.0",
3736
"@testing-library/jest-dom": "4.2.4",
3837
"@testing-library/react": "9.3.2",
3938
"@testing-library/user-event": "7.1.2",
4039
"@tsed/logger": "5.5.2",
40+
"@types/async-retry": "1.4.2",
41+
"@types/configstore": "4.0.0",
42+
"@types/jest": "24.0.0",
4143
"async-retry": "1.3.1",
4244
"axios": "0.21.1",
4345
"configstore": "5.0.1",

public/favicon.ico

11.7 KB
Binary file not shown.

scripts/bootstrap-contracts-config.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ interface BoostrapStorageCallback {
1414
interface BootstrapContractParams {
1515
configKey: string;
1616
contractFilename: string;
17+
contractGitHash: string;
1718
contractAlias: string;
1819
initStorage: BoostrapStorageCallback;
1920
}
@@ -63,11 +64,11 @@ async function getContractAddress(
6364
}
6465

6566
async function fetchContractCode(
66-
contractFilename: string
67+
contractFilename: string,
68+
contractGitHash: string
6769
): Promise<ContractCodeResponse> {
6870
const rawRepoUrl = 'https://raw.githubusercontent.com/tqtezos/minter-sdk';
69-
const gitHash = 'aec441412d53653fa0048fee7c12c1eb1365909b';
70-
const contractCodeUrl = `${rawRepoUrl}/${gitHash}/contracts/bin/${contractFilename}`;
71+
const contractCodeUrl = `${rawRepoUrl}/${contractGitHash}/contracts/bin/${contractFilename}`;
7172
const response = await axios.get(contractCodeUrl);
7273
return { code: response.data, url: contractCodeUrl };
7374
}
@@ -130,7 +131,8 @@ async function bootstrapContract(
130131
let contract;
131132
try {
132133
const { code, url: contractCodeUrl } = await fetchContractCode(
133-
params.contractFilename
134+
params.contractFilename,
135+
params.contractGitHash
134136
);
135137

136138
$log.info(
@@ -175,6 +177,7 @@ async function bootstrap(env: string) {
175177
configKey: 'contracts.nftFaucet',
176178
contractAlias: 'nftFaucet',
177179
contractFilename: 'fa2_multi_nft_faucet.tz',
180+
contractGitHash: 'aec441412d53653fa0048fee7c12c1eb1365909b',
178181
initStorage: initStorageNftFaucet
179182
});
180183

@@ -183,6 +186,7 @@ async function bootstrap(env: string) {
183186
configKey: 'contracts.marketplace.fixedPrice.tez',
184187
contractAlias: 'fixedPriceMarketTez',
185188
contractFilename: 'fixed_price_sale_market_tez.tz',
189+
contractGitHash: '8f67bb8c2abc12b8e6f8e529e1412262972deab3',
186190
initStorage: () => new MichelsonMap()
187191
});
188192
}

src/components/App/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import SplashPage from '../SplashPage';
44
import CreateNonFungiblePage from '../CreateNonFungiblePage';
55
import CollectionsCatalog from '../Collections/Catalog';
66
import CollectionsTokenDetail from '../Collections/TokenDetail';
7+
import MarketplaceCatalog from '../Marketplace/Catalog';
78
import Header from '../common/Header';
89
import { Flex } from '@chakra-ui/react';
910
import Notifications from '../common/Notifications';
@@ -40,6 +41,9 @@ export default function App() {
4041
<Route path="/collections">
4142
<CollectionsCatalog />
4243
</Route>
44+
<Route path="/marketplace">
45+
<MarketplaceCatalog />
46+
</Route>
4347
<Route path="/collection/:contractAddress/token/:tokenId">
4448
{({ contractAddress, tokenId }) => (
4549
<CollectionsTokenDetail
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import React from 'react';
2+
import {
3+
Box,
4+
Button,
5+
Flex,
6+
Menu,
7+
MenuButton,
8+
MenuList,
9+
MenuOptionGroup,
10+
MenuItemOption,
11+
Text
12+
} from '@chakra-ui/react';
13+
import { useSelector, useDispatch } from '../../../reducer';
14+
import { selectCollection } from '../../../reducer/slices/collections';
15+
import { ChevronDown } from 'react-feather';
16+
17+
export default function CollectionsDropdown() {
18+
const state = useSelector(s => s.collections);
19+
const dispatch = useDispatch();
20+
21+
return (
22+
<Menu>
23+
<MenuButton as={Button} border="1px solid" borderColor="brand.gray">
24+
<Flex align="center">
25+
<Box mr={3}>
26+
<ChevronDown />
27+
</Box>
28+
Collections
29+
</Flex>
30+
</MenuButton>
31+
<MenuList>
32+
<MenuOptionGroup
33+
type="radio"
34+
defaultValue={state.selectedCollection || ''}
35+
>
36+
<Text ml={4} my={2} fontWeight="600">
37+
Featured
38+
</Text>
39+
<MenuItemOption
40+
key={state.globalCollection}
41+
selected={state.globalCollection === state.selectedCollection}
42+
value={state.globalCollection}
43+
onSelect={() => dispatch(selectCollection(state.globalCollection))}
44+
>
45+
{state.collections[state.globalCollection].metadata.name}
46+
</MenuItemOption>
47+
<Text ml={4} my={2} fontWeight="600">
48+
Your Collections
49+
</Text>
50+
{Object.keys(state.collections)
51+
.filter(address => address !== state.globalCollection)
52+
.map(address => (
53+
<MenuItemOption
54+
key={address}
55+
value={address}
56+
selected={address === state.selectedCollection}
57+
onClick={() => dispatch(selectCollection(address))}
58+
>
59+
{state.collections[address].metadata.name}
60+
</MenuItemOption>
61+
))}
62+
</MenuOptionGroup>
63+
</MenuList>
64+
</Menu>
65+
);
66+
}

src/components/Collections/Catalog/TokenGrid.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useState } from 'react';
22
import { useLocation } from 'wouter';
3-
import { AspectRatio, Box, Flex, Grid, Image, Text } from '@chakra-ui/react';
3+
import { AspectRatio, Box, Flex, SimpleGrid, Image, Text } from '@chakra-ui/react';
44
import { Wind, HelpCircle } from 'react-feather';
55
import { Token, CollectionsState } from '../../../reducer/slices/collections';
66
import { ipfsUriToGatewayUrl } from '../../../lib/util/ipfs';
@@ -169,7 +169,7 @@ export default function TokenGrid({ state, walletAddress }: TokenGridProps) {
169169
}
170170

171171
return (
172-
<Grid templateColumns="repeat(4, 1fr)" gap={8} pb={8}>
172+
<SimpleGrid columns={{sm: 1, md: 2, lg: 3, xl: 4}} gap={8} pb={8}>
173173
{tokens.map(token => {
174174
return (
175175
<TokenTile
@@ -180,6 +180,6 @@ export default function TokenGrid({ state, walletAddress }: TokenGridProps) {
180180
/>
181181
);
182182
})}
183-
</Grid>
183+
</SimpleGrid>
184184
);
185185
}

src/components/Collections/Catalog/index.tsx

Lines changed: 69 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React, { useEffect } from 'react';
2-
import { Box, Flex, Heading, Text } from '@chakra-ui/react';
2+
import { Box, Flex, Heading, Text, Link, Spinner } from '@chakra-ui/react';
33
import { useLocation } from 'wouter';
4-
import { RefreshCw } from 'react-feather';
4+
import { RefreshCw, ExternalLink } from 'react-feather';
55
import { MinterButton } from '../../common';
66
import Sidebar from './Sidebar';
77
import TokenGrid from './TokenGrid';
8+
import CollectionsDropdown from './CollectionsDropdown';
89

910
import { useSelector, useDispatch } from '../../../reducer';
1011
import {
@@ -48,8 +49,25 @@ export default function Catalog() {
4849
const collection = state.collections[selectedCollection];
4950

5051
return (
51-
<Flex flex="1" w="100%" minHeight="0">
52-
<Flex w="250px" h="100%" flexDir="column" overflowY="scroll">
52+
<Flex
53+
flex="1"
54+
w="100%"
55+
minHeight="0"
56+
flexDir={{
57+
base: 'column',
58+
md: 'row'
59+
}}
60+
>
61+
<Flex
62+
w="250px"
63+
h="100%"
64+
flexDir="column"
65+
overflowY="scroll"
66+
display={{
67+
base: 'none',
68+
md: 'flex'
69+
}}
70+
>
5371
<Sidebar />
5472
</Flex>
5573
<Flex
@@ -65,12 +83,39 @@ export default function Catalog() {
6583
overflowY="scroll"
6684
justify="start"
6785
>
68-
<Flex w="100%" pb={6} justify="space-between" align="center">
69-
<Flex flexDir="column">
70-
<Heading size="lg">{collection.metadata.name || ''}</Heading>
71-
<Text fontFamily="mono" color="brand.lightGray">
72-
{collection.address}
73-
</Text>
86+
<Flex
87+
w="100%"
88+
pb={6}
89+
justify="space-between"
90+
align={{
91+
base: 'flex-start',
92+
md: 'center'
93+
}}
94+
flexDir={{
95+
base: 'column',
96+
md: 'row'
97+
}}
98+
>
99+
<Flex flexDir="column" width="100%">
100+
<Flex justify="space-between" width="100%">
101+
<Heading size="lg">{collection.metadata.name || ''}</Heading>
102+
<Flex display={{ base: 'flex', md: 'none' }}>
103+
<CollectionsDropdown />
104+
</Flex>
105+
</Flex>
106+
<Flex align="center">
107+
<Text fontFamily="mono" color="brand.lightGray">
108+
{collection.address}
109+
</Text>
110+
<Link
111+
href={system.config.bcd.gui + '/' + collection.address}
112+
color="brand.darkGray"
113+
isExternal
114+
ml={2}
115+
>
116+
<ExternalLink size={16} />
117+
</Link>
118+
</Flex>
74119
</Flex>
75120
<MinterButton
76121
variant="primaryActionInverted"
@@ -80,14 +125,27 @@ export default function Catalog() {
80125
dispatch(getContractNftsQuery(selectedCollection));
81126
}
82127
}}
128+
mt={{
129+
base: 4,
130+
md: 0
131+
}}
83132
>
84133
<Box color="currentcolor">
85134
<RefreshCw size={16} strokeWidth="3" />
86135
</Box>
87136
<Text ml={2}>Refresh</Text>
88137
</MinterButton>
89138
</Flex>
90-
<TokenGrid state={state} walletAddress={system.tzPublicKey} />
139+
{!collection.loaded ? (
140+
<Flex flexDir="column" align="center" flex="1" pt={20}>
141+
<Spinner size="xl" mb={6} color="gray.300" />
142+
<Heading size="lg" textAlign="center" color="gray.500">
143+
Loading...
144+
</Heading>
145+
</Flex>
146+
) : (
147+
<TokenGrid state={state} walletAddress={system.tzPublicKey} />
148+
)}
91149
</Flex>
92150
</Flex>
93151
);

0 commit comments

Comments
 (0)