Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffery.YH.Lin authored and Jeffery.YH.Lin committed Oct 22, 2021
2 parents a95731d + 8477609 commit c1fd7e6
Show file tree
Hide file tree
Showing 52 changed files with 23,863 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ node_modules/
# hardhat files
cache/
artifacts/
frontend/src/hardhat/
# frontend/src/hardhat/
coverage/
coverage.json

Expand Down
4 changes: 2 additions & 2 deletions control/DeployEnable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const deployEnable: boolean[] = [
/* Ticket */ true,
/* Ticket */ false,
/* Blindbox */ true,
/* Gallery */ true,
/* Gallery */ false,
];
15 changes: 13 additions & 2 deletions frontend/src/components/NFTTemplateCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ import { ProviderContext, SignerContext } from "../hardhat/SymfoniContext";
import { NoobFriendlyTokenTemplate__factory } from "../hardhat/typechain/factories/NoobFriendlyTokenTemplate__factory";
import { NoobFriendlyTokenTemplate } from "../hardhat/typechain/NoobFriendlyTokenTemplate";
import { NFTTypeArray } from "./NFTTypeArray";

const GATEWAY = new URL('https://dweb.link/')

const toGatewayURL = (url: any, options: any = {}) => {
const gateway = options.gateway || GATEWAY
url = new URL(String(url))
return url.protocol === 'ipfs:'
? new URL(`/ipfs/${url.href.slice('ipfs://'.length)}`, gateway)
: url
}

const useStyles = makeStyles((theme) => ({
media: {
objectFit: 'contain',
Expand Down Expand Up @@ -69,13 +80,13 @@ export const NFTTemplateCard: React.FC<Props> = (props) => {
const updateImageURI = async () => {
const baseURI = await template?.baseURI();
if (baseURI) {
fetch(`https://ipfs.io/ipfs/${baseURI?.slice(7)}0`)
fetch(toGatewayURL(baseURI).toString()+'0')
.then((res) => {
if (res.status === 404) throw Error("URI error: 404");
return res.json();
})
.then((metadata) => {
const imgURI = "https://ipfs.io/ipfs/" + metadata.image.slice(7);
const imgURI = toGatewayURL(metadata.image).toString();
setImageURI(imgURI);
})
.catch((err) => {
Expand Down
387 changes: 387 additions & 0 deletions frontend/src/hardhat/SymfoniContext.tsx

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions frontend/src/hardhat/deployments/rinkeby/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
288 changes: 288 additions & 0 deletions frontend/src/hardhat/deployments/rinkeby/NFTBlindboxGenerator.json

Large diffs are not rendered by default.

Loading

0 comments on commit c1fd7e6

Please sign in to comment.