From 3b6224db13e33ffd9b872de9ee4e7f2d68a89a1f Mon Sep 17 00:00:00 2001 From: name-user1 Date: Thu, 19 Jan 2023 10:34:28 +0300 Subject: [PATCH 01/21] Warming Module --- .env.example | 17 --- components/Lister.tsx | 17 +++ components/Sidebar.tsx | 1 + pages/collections/warmup.tsx | 194 +++++++++++++++++++++++++++++++++++ 4 files changed, 212 insertions(+), 17 deletions(-) delete mode 100644 .env.example create mode 100644 components/Lister.tsx create mode 100644 pages/collections/warmup.tsx diff --git a/.env.example b/.env.example deleted file mode 100644 index 386ce93..0000000 --- a/.env.example +++ /dev/null @@ -1,17 +0,0 @@ -APP_VERSION=0.3.7 - -NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS -NEXT_PUBLIC_SG721_CODE_ID=274 -NEXT_PUBLIC_VENDING_MINTER_CODE_ID=275 -NEXT_PUBLIC_VENDING_FACTORY_ADDRESS="stars1j4qn9krchp5xs8nued4j4vcr4j654wxkhf7acy76734xe5fsz08sku28s2" -NEXT_PUBLIC_BASE_FACTORY_ADDRESS="stars1c6juqgd7cm80afpmuszun66rl9zdc4kgfht8fk34tfq3zk87l78sdxngzv" -NEXT_PUBLIC_SG721_NAME_ADDRESS="stars1fx74nkqkw2748av8j7ew7r3xt9cgjqduwn8m0ur5lhe49uhlsasszc5fhr" -NEXT_PUBLIC_BASE_MINTER_CODE_ID=613 -NEXT_PUBLIC_WHITELIST_CODE_ID=277 - - -NEXT_PUBLIC_API_URL=https://nft-api.elgafar-1.stargaze-apis.com -NEXT_PUBLIC_BLOCK_EXPLORER_URL=https://testnet-explorer.publicawesome.dev/stargaze -NEXT_PUBLIC_NETWORK=testnet -NEXT_PUBLIC_STARGAZE_WEBSITE_URL=https://testnet.publicawesome.dev -NEXT_PUBLIC_WEBSITE_URL=https:// \ No newline at end of file diff --git a/components/Lister.tsx b/components/Lister.tsx new file mode 100644 index 0000000..aa12fc8 --- /dev/null +++ b/components/Lister.tsx @@ -0,0 +1,17 @@ +import React from 'react' + +export interface ListerProps { + data: string + key: string +} + +function Lister({ data, key }: ListerProps) { + return ( + + {key}-{data} + + ) +} + +// eslint-disable-next-line import/no-default-export +export default Lister diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 5e44882..4398384 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -14,6 +14,7 @@ const routes = [ { text: 'Create a Collection', href: `/collections/create/`, isChild: true }, { text: 'My Collections', href: `/collections/myCollections/`, isChild: true }, { text: 'Collection Actions', href: `/collections/actions/`, isChild: true }, + { text: 'Warm Up', href: `/collections/warmup/`, isChild: true }, { text: 'Contract Dashboards', href: `/contracts/`, isChild: false }, { text: 'Base Minter Contract', href: `/contracts/baseMinter/`, isChild: true }, { text: 'Vending Minter Contract', href: `/contracts/vendingMinter/`, isChild: true }, diff --git a/pages/collections/warmup.tsx b/pages/collections/warmup.tsx new file mode 100644 index 0000000..b3d64b1 --- /dev/null +++ b/pages/collections/warmup.tsx @@ -0,0 +1,194 @@ +import axios from 'axios' +import { Button } from 'components/Button' +import { dispatchQuery } from 'components/collections/queries/query' +import { ContractPageHeader } from 'components/ContractPageHeader' +import { AddressInput } from 'components/forms/FormInput' +import { useInputState } from 'components/forms/FormInput.hooks' +import Lister from 'components/Lister' +import { useContracts } from 'contexts/contracts' +import type { NextPage } from 'next' +import { NextSeo } from 'next-seo' +import { useEffect, useMemo, useState } from 'react' +import { toast } from 'react-hot-toast' +import { useQuery } from 'react-query' +import { withMetadata } from 'utils/layout' +import { links } from 'utils/links' + +const CollectionQueriesPage: NextPage = () => { + const { baseMinter: baseMinterContract, vendingMinter: vendingMinterContract, sg721: sg721Contract } = useContracts() + const type = 'config' + const sg721ContractAddress = `sg721ContractState.value` + const [doneList, setDoneList] = useState([]) + const [processList, setProcessList] = useState([]) + const [numTokens, setNumTokens] = useState(0) + const [pers, setPers] = useState(0) + const minterContractState = useInputState({ + id: 'minter-contract-address', + name: 'minter-contract-address', + title: 'Minter Address', + subtitle: 'Address of the Minter contract', + }) + const minterContractAddress = minterContractState.value + + const vendingMinterMessages = useMemo( + () => vendingMinterContract?.use(minterContractAddress), + [vendingMinterContract, minterContractAddress], + ) + const baseMinterMessages = useMemo( + () => baseMinterContract?.use(minterContractAddress), + [baseMinterContract, minterContractAddress], + ) + const sg721Messages = useMemo(() => sg721Contract?.use(sg721ContractAddress), [sg721Contract, sg721ContractAddress]) + + const { data: response } = useQuery( + [sg721Messages, baseMinterMessages, vendingMinterMessages, type] as const, + async ({ queryKey }) => { + const [_sg721Messages, _baseMinterMessages_, _vendingMinterMessages, _type] = queryKey + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const result = await dispatchQuery({ + vendingMinterMessages: _vendingMinterMessages, + baseMinterMessages: _baseMinterMessages_, + sg721Messages: _sg721Messages, + type: _type, + }) + return result + }, + { + placeholderData: null, + onError: (error: any) => { + toast.error(error.message, { style: { maxWidth: 'none' } }) + }, + enabled: Boolean(sg721ContractAddress && minterContractAddress && type), + retry: false, + }, + ) + + useEffect(() => { + if (response) { + setNumTokens(response['num_tokens']) + } + }, [response]) + + useEffect(() => { + if (numTokens !== 0) setPers((100 * doneList.length) / numTokens) + else setPers(0) + }, [doneList.length, numTokens]) + + function chooseAlternate(url: string, attempt: number) { + let alternate + switch (attempt) { + case 1: { + alternate = url.replace('ipfs://', 'https://ipfs.stargaze.zone/ipfs/') + break + } + case 2: { + alternate = url.replace('ipfs://', 'https://ipfs.io/ipfs/') + break + } + case 3: { + alternate = url.replace('ipfs://', 'https://cf-ipfs.com/ipfs/') + break + } + default: { + alternate = url.replace('ipfs://', 'https://ipfs-gw.stargaze-apis.com/ipfs/') + break + } + } + return alternate + } + + async function warmOne(i: number, image: string, attempt: number, totalAttempt: number) { + setProcessList((existingItems) => { + return [i, ...existingItems] + }) + const link = image.replace('1', i.toString()) + + try { + const result = await axios.get(chooseAlternate(link, attempt)) + + if (result.status === 200) { + setDoneList((existingItems) => { + return [i, ...existingItems] + }) + setProcessList((existingItems) => { + const index = existingItems.indexOf(i, 0) + if (index > -1) { + existingItems.splice(index, 1) + } + return existingItems + }) + return + } + } catch (e) { + console.log('hata: ', i, e) + } + if (totalAttempt !== 4) { + void warmOne(i, image, attempt === 3 ? 0 : attempt + 1, attempt === 3 ? totalAttempt + 1 : totalAttempt) + } + } + + async function warmingProcess(url: string, attempt: number) { + const link = `${chooseAlternate(url, attempt)}/1` + try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const { data, status } = await axios.get(link) + if (status === 200) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + for (let i = 1; i <= response['num_tokens']; i++) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access + void warmOne(i, data.image, 0, 0) + } + } else if (attempt < 3) { + void warmingProcess(url, attempt + 1) + } else toast.error('File can not be reachable at the moment! Please try again later...') + } catch (e) { + console.log(e) + } + } + + return ( +
+ + +
+ +
+
+
+
+
Total
+
Warmed
+
Percentage
+
+
+
{numTokens}
+
{doneList.length}
+
%{pers}
+
+
+
+ +
+
+ +
+ {processList.map((value: number, index: number) => { + return + })} +
+
+ ) +} + +export default withMetadata(CollectionQueriesPage, { center: false }) From fc20a541e26b0890a35f6796dacaa41412a0ec76 Mon Sep 17 00:00:00 2001 From: name-user1 Date: Thu, 19 Jan 2023 10:59:55 +0300 Subject: [PATCH 02/21] Small fixes --- .env.example | 17 +++++++++++++++++ pages/collections/warmup.tsx | 9 +++++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..386ce93 --- /dev/null +++ b/.env.example @@ -0,0 +1,17 @@ +APP_VERSION=0.3.7 + +NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS +NEXT_PUBLIC_SG721_CODE_ID=274 +NEXT_PUBLIC_VENDING_MINTER_CODE_ID=275 +NEXT_PUBLIC_VENDING_FACTORY_ADDRESS="stars1j4qn9krchp5xs8nued4j4vcr4j654wxkhf7acy76734xe5fsz08sku28s2" +NEXT_PUBLIC_BASE_FACTORY_ADDRESS="stars1c6juqgd7cm80afpmuszun66rl9zdc4kgfht8fk34tfq3zk87l78sdxngzv" +NEXT_PUBLIC_SG721_NAME_ADDRESS="stars1fx74nkqkw2748av8j7ew7r3xt9cgjqduwn8m0ur5lhe49uhlsasszc5fhr" +NEXT_PUBLIC_BASE_MINTER_CODE_ID=613 +NEXT_PUBLIC_WHITELIST_CODE_ID=277 + + +NEXT_PUBLIC_API_URL=https://nft-api.elgafar-1.stargaze-apis.com +NEXT_PUBLIC_BLOCK_EXPLORER_URL=https://testnet-explorer.publicawesome.dev/stargaze +NEXT_PUBLIC_NETWORK=testnet +NEXT_PUBLIC_STARGAZE_WEBSITE_URL=https://testnet.publicawesome.dev +NEXT_PUBLIC_WEBSITE_URL=https:// \ No newline at end of file diff --git a/pages/collections/warmup.tsx b/pages/collections/warmup.tsx index b3d64b1..7c11d4d 100644 --- a/pages/collections/warmup.tsx +++ b/pages/collections/warmup.tsx @@ -66,6 +66,7 @@ const CollectionQueriesPage: NextPage = () => { useEffect(() => { if (response) { setNumTokens(response['num_tokens']) + setPers(0) } }, [response]) @@ -148,11 +149,11 @@ const CollectionQueriesPage: NextPage = () => { return (
- +
@@ -167,7 +168,7 @@ const CollectionQueriesPage: NextPage = () => {
{numTokens}
{doneList.length}
-
%{pers}
+
{(Math.round(pers * 100) / 100).toFixed(2)}%
From de79ffa1db614557173d203ecb27af525174db75 Mon Sep 17 00:00:00 2001 From: name-user1 Date: Thu, 19 Jan 2023 12:12:57 +0300 Subject: [PATCH 03/21] Routing --- pages/collections/warmup.tsx | 43 +++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/pages/collections/warmup.tsx b/pages/collections/warmup.tsx index 7c11d4d..bec6c21 100644 --- a/pages/collections/warmup.tsx +++ b/pages/collections/warmup.tsx @@ -7,6 +7,7 @@ import { useInputState } from 'components/forms/FormInput.hooks' import Lister from 'components/Lister' import { useContracts } from 'contexts/contracts' import type { NextPage } from 'next' +import { useRouter } from 'next/router' import { NextSeo } from 'next-seo' import { useEffect, useMemo, useState } from 'react' import { toast } from 'react-hot-toast' @@ -20,6 +21,7 @@ const CollectionQueriesPage: NextPage = () => { const sg721ContractAddress = `sg721ContractState.value` const [doneList, setDoneList] = useState([]) const [processList, setProcessList] = useState([]) + const [errorList, setErrorList] = useState([]) const [numTokens, setNumTokens] = useState(0) const [pers, setPers] = useState(0) const minterContractState = useInputState({ @@ -40,6 +42,20 @@ const CollectionQueriesPage: NextPage = () => { ) const sg721Messages = useMemo(() => sg721Contract?.use(sg721ContractAddress), [sg721Contract, sg721ContractAddress]) + const router = useRouter() + + useEffect(() => { + if (minterContractState.value.length > 0) { + void router.replace({ query: { minterContractAddress } }) + } + }, [minterContractState.value]) + + useEffect(() => { + const initial = new URL(document.URL).searchParams.get('minterContractAddress') + if (initial && initial.length > 0) minterContractState.onChange(initial) + console.log(minterContractState, minterContractAddress) + }, []) + const { data: response } = useQuery( [sg721Messages, baseMinterMessages, vendingMinterMessages, type] as const, async ({ queryKey }) => { @@ -67,7 +83,10 @@ const CollectionQueriesPage: NextPage = () => { if (response) { setNumTokens(response['num_tokens']) setPers(0) - } + setDoneList([]) + setProcessList([]) + setErrorList([]) + } else setNumTokens(0) }, [response]) useEffect(() => { @@ -79,7 +98,7 @@ const CollectionQueriesPage: NextPage = () => { let alternate switch (attempt) { case 1: { - alternate = url.replace('ipfs://', 'https://ipfs.stargaze.zone/ipfs/') + alternate = url.replace('ipfs://', 'https://cf-ipfs.com/ipfs/') break } case 2: { @@ -87,11 +106,11 @@ const CollectionQueriesPage: NextPage = () => { break } case 3: { - alternate = url.replace('ipfs://', 'https://cf-ipfs.com/ipfs/') + alternate = url.replace('ipfs://', 'https://ipfs-gw.stargaze-apis.com/ipfs/') break } default: { - alternate = url.replace('ipfs://', 'https://ipfs-gw.stargaze-apis.com/ipfs/') + alternate = url.replace('ipfs://', 'https://ipfs.stargaze.zone/ipfs/') break } } @@ -125,6 +144,17 @@ const CollectionQueriesPage: NextPage = () => { } if (totalAttempt !== 4) { void warmOne(i, image, attempt === 3 ? 0 : attempt + 1, attempt === 3 ? totalAttempt + 1 : totalAttempt) + } else { + setErrorList((existingItems) => { + return [i, ...existingItems] + }) + setProcessList((existingItems) => { + const index = existingItems.indexOf(i, 0) + if (index > -1) { + existingItems.splice(index, 1) + } + return existingItems + }) } } @@ -175,6 +205,9 @@ const CollectionQueriesPage: NextPage = () => {
- {processList.map((value: number, index: number) => { + {errorList.map((value: number, index: number) => { return })}
From aeec57bdefb9b64ced35e30da0fe60350dc77e8b Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Thu, 19 Jan 2023 13:30:16 +0300 Subject: [PATCH 04/21] Query update --- pages/collections/warmup.tsx | 70 ++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/pages/collections/warmup.tsx b/pages/collections/warmup.tsx index bec6c21..40c736f 100644 --- a/pages/collections/warmup.tsx +++ b/pages/collections/warmup.tsx @@ -1,71 +1,63 @@ +/* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ import axios from 'axios' import { Button } from 'components/Button' -import { dispatchQuery } from 'components/collections/queries/query' import { ContractPageHeader } from 'components/ContractPageHeader' import { AddressInput } from 'components/forms/FormInput' import { useInputState } from 'components/forms/FormInput.hooks' import Lister from 'components/Lister' import { useContracts } from 'contexts/contracts' +import { dispatchQuery } from 'contracts/vendingMinter/messages/query' import type { NextPage } from 'next' import { useRouter } from 'next/router' import { NextSeo } from 'next-seo' -import { useEffect, useMemo, useState } from 'react' +import { useEffect, useState } from 'react' import { toast } from 'react-hot-toast' import { useQuery } from 'react-query' import { withMetadata } from 'utils/layout' import { links } from 'utils/links' +import { useWallet } from '../../contexts/wallet' + const CollectionQueriesPage: NextPage = () => { - const { baseMinter: baseMinterContract, vendingMinter: vendingMinterContract, sg721: sg721Contract } = useContracts() - const type = 'config' - const sg721ContractAddress = `sg721ContractState.value` + const { vendingMinter: vendingMinterContract } = useContracts() + const wallet = useWallet() + const [doneList, setDoneList] = useState([]) const [processList, setProcessList] = useState([]) const [errorList, setErrorList] = useState([]) const [numTokens, setNumTokens] = useState(0) - const [pers, setPers] = useState(0) + const [percentage, setPercentage] = useState(0) const minterContractState = useInputState({ id: 'minter-contract-address', name: 'minter-contract-address', - title: 'Minter Address', - subtitle: 'Address of the Minter contract', + title: 'Minter Contract Address', + defaultValue: '', + placeholder: 'stars1...', }) const minterContractAddress = minterContractState.value - const vendingMinterMessages = useMemo( - () => vendingMinterContract?.use(minterContractAddress), - [vendingMinterContract, minterContractAddress], - ) - const baseMinterMessages = useMemo( - () => baseMinterContract?.use(minterContractAddress), - [baseMinterContract, minterContractAddress], - ) - const sg721Messages = useMemo(() => sg721Contract?.use(sg721ContractAddress), [sg721Contract, sg721ContractAddress]) - const router = useRouter() useEffect(() => { - if (minterContractState.value.length > 0) { + if (minterContractAddress.length > 0) { void router.replace({ query: { minterContractAddress } }) } - }, [minterContractState.value]) + }, [minterContractAddress]) useEffect(() => { const initial = new URL(document.URL).searchParams.get('minterContractAddress') if (initial && initial.length > 0) minterContractState.onChange(initial) - console.log(minterContractState, minterContractAddress) }, []) const { data: response } = useQuery( - [sg721Messages, baseMinterMessages, vendingMinterMessages, type] as const, - async ({ queryKey }) => { - const [_sg721Messages, _baseMinterMessages_, _vendingMinterMessages, _type] = queryKey - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + [minterContractAddress, vendingMinterContract, wallet] as const, + async () => { + const messages = vendingMinterContract?.use(minterContractAddress) const result = await dispatchQuery({ - vendingMinterMessages: _vendingMinterMessages, - baseMinterMessages: _baseMinterMessages_, - sg721Messages: _sg721Messages, - type: _type, + address: '', + messages, + type: 'config', }) return result }, @@ -74,15 +66,14 @@ const CollectionQueriesPage: NextPage = () => { onError: (error: any) => { toast.error(error.message, { style: { maxWidth: 'none' } }) }, - enabled: Boolean(sg721ContractAddress && minterContractAddress && type), - retry: false, + enabled: Boolean(minterContractAddress && vendingMinterContract), }, ) useEffect(() => { if (response) { setNumTokens(response['num_tokens']) - setPers(0) + setPercentage(0) setDoneList([]) setProcessList([]) setErrorList([]) @@ -90,8 +81,8 @@ const CollectionQueriesPage: NextPage = () => { }, [response]) useEffect(() => { - if (numTokens !== 0) setPers((100 * doneList.length) / numTokens) - else setPers(0) + if (numTokens !== 0) setPercentage((100 * doneList.length) / numTokens) + else setPercentage(0) }, [doneList.length, numTokens]) function chooseAlternate(url: string, attempt: number) { @@ -140,7 +131,7 @@ const CollectionQueriesPage: NextPage = () => { return } } catch (e) { - console.log('hata: ', i, e) + console.log('error: ', i, e) } if (totalAttempt !== 4) { void warmOne(i, image, attempt === 3 ? 0 : attempt + 1, attempt === 3 ? totalAttempt + 1 : totalAttempt) @@ -161,7 +152,6 @@ const CollectionQueriesPage: NextPage = () => { async function warmingProcess(url: string, attempt: number) { const link = `${chooseAlternate(url, attempt)}/1` try { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const { data, status } = await axios.get(link) if (status === 200) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access @@ -179,11 +169,11 @@ const CollectionQueriesPage: NextPage = () => { return (
- +
@@ -198,7 +188,7 @@ const CollectionQueriesPage: NextPage = () => {
{numTokens}
{doneList.length}
-
{(Math.round(pers * 100) / 100).toFixed(2)}%
+
{(Math.round(percentage * 100) / 100).toFixed(2)}%
From de263c604ecc577654d64dacc0a8b59aacd48b38 Mon Sep 17 00:00:00 2001 From: name-user1 Date: Fri, 20 Jan 2023 16:57:09 +0300 Subject: [PATCH 05/21] Progress bar added --- pages/collections/warmup.tsx | 91 +++++++++++++++++------------------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/pages/collections/warmup.tsx b/pages/collections/warmup.tsx index 40c736f..f4d6c79 100644 --- a/pages/collections/warmup.tsx +++ b/pages/collections/warmup.tsx @@ -1,33 +1,33 @@ /* eslint-disable eslint-comments/disable-enable-pair */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ +import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate' import axios from 'axios' import { Button } from 'components/Button' import { ContractPageHeader } from 'components/ContractPageHeader' import { AddressInput } from 'components/forms/FormInput' import { useInputState } from 'components/forms/FormInput.hooks' import Lister from 'components/Lister' -import { useContracts } from 'contexts/contracts' -import { dispatchQuery } from 'contracts/vendingMinter/messages/query' import type { NextPage } from 'next' import { useRouter } from 'next/router' import { NextSeo } from 'next-seo' import { useEffect, useState } from 'react' import { toast } from 'react-hot-toast' -import { useQuery } from 'react-query' import { withMetadata } from 'utils/layout' import { links } from 'utils/links' -import { useWallet } from '../../contexts/wallet' +interface ConfigResponse { + num_tokens: number + base_token_uri: string +} const CollectionQueriesPage: NextPage = () => { - const { vendingMinter: vendingMinterContract } = useContracts() - const wallet = useWallet() - + const [client, setClient] = useState() + const [baseUri, SetBaseUri] = useState('') const [doneList, setDoneList] = useState([]) const [processList, setProcessList] = useState([]) const [errorList, setErrorList] = useState([]) const [numTokens, setNumTokens] = useState(0) - const [percentage, setPercentage] = useState(0) + const [percentage, setPercentage] = useState('0.00') const minterContractState = useInputState({ id: 'minter-contract-address', name: 'minter-contract-address', @@ -39,6 +39,30 @@ const CollectionQueriesPage: NextPage = () => { const router = useRouter() + useEffect(() => { + async function init() { + setClient(await CosmWasmClient.connect('https://rpc.elgafar-1.stargaze-apis.com/')) //'https://rpc.stargaze-apis.com/')) + } + void init() + }, []) + + useEffect(() => { + async function get() { + if (client && minterContractAddress) { + const res: ConfigResponse = await client.queryContractSmart(minterContractAddress, { + config: {}, + }) + setNumTokens(res.num_tokens) + SetBaseUri(res.base_token_uri) + setPercentage('0.00') + setDoneList([]) + setProcessList([]) + setErrorList([]) + } + } + void get() + }, [minterContractAddress, client]) + useEffect(() => { if (minterContractAddress.length > 0) { void router.replace({ query: { minterContractAddress } }) @@ -50,39 +74,9 @@ const CollectionQueriesPage: NextPage = () => { if (initial && initial.length > 0) minterContractState.onChange(initial) }, []) - const { data: response } = useQuery( - [minterContractAddress, vendingMinterContract, wallet] as const, - async () => { - const messages = vendingMinterContract?.use(minterContractAddress) - const result = await dispatchQuery({ - address: '', - messages, - type: 'config', - }) - return result - }, - { - placeholderData: null, - onError: (error: any) => { - toast.error(error.message, { style: { maxWidth: 'none' } }) - }, - enabled: Boolean(minterContractAddress && vendingMinterContract), - }, - ) - useEffect(() => { - if (response) { - setNumTokens(response['num_tokens']) - setPercentage(0) - setDoneList([]) - setProcessList([]) - setErrorList([]) - } else setNumTokens(0) - }, [response]) - - useEffect(() => { - if (numTokens !== 0) setPercentage((100 * doneList.length) / numTokens) - else setPercentage(0) + if (numTokens !== 0) setPercentage((((Math.round(100 * doneList.length) / numTokens) * 100) / 100).toFixed(2)) + else setPercentage('0') }, [doneList.length, numTokens]) function chooseAlternate(url: string, attempt: number) { @@ -154,8 +148,7 @@ const CollectionQueriesPage: NextPage = () => { try { const { data, status } = await axios.get(link) if (status === 200) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - for (let i = 1; i <= response['num_tokens']; i++) { + for (let i = 1; i <= numTokens; i++) { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access void warmOne(i, data.image, 0, 0) } @@ -180,7 +173,7 @@ const CollectionQueriesPage: NextPage = () => {
-
+
Total
Warmed
Percentage
@@ -188,24 +181,26 @@ const CollectionQueriesPage: NextPage = () => {
{numTokens}
{doneList.length}
-
{(Math.round(percentage * 100) / 100).toFixed(2)}%
+
{percentage}%
+
+
+
-
+
-
{errorList.map((value: number, index: number) => { return From 94d7d1571cb5c2b090ceb237087129bb9d7bba65 Mon Sep 17 00:00:00 2001 From: name-user1 Date: Tue, 31 Jan 2023 17:14:58 +0300 Subject: [PATCH 06/21] Minor changes --- components/Sidebar.tsx | 1 - pages/collections/warmup.tsx | 96 ++++++++++++++++++------------------ 2 files changed, 49 insertions(+), 48 deletions(-) diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 4398384..5e44882 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -14,7 +14,6 @@ const routes = [ { text: 'Create a Collection', href: `/collections/create/`, isChild: true }, { text: 'My Collections', href: `/collections/myCollections/`, isChild: true }, { text: 'Collection Actions', href: `/collections/actions/`, isChild: true }, - { text: 'Warm Up', href: `/collections/warmup/`, isChild: true }, { text: 'Contract Dashboards', href: `/contracts/`, isChild: false }, { text: 'Base Minter Contract', href: `/contracts/baseMinter/`, isChild: true }, { text: 'Vending Minter Contract', href: `/contracts/vendingMinter/`, isChild: true }, diff --git a/pages/collections/warmup.tsx b/pages/collections/warmup.tsx index f4d6c79..af8d2cf 100644 --- a/pages/collections/warmup.tsx +++ b/pages/collections/warmup.tsx @@ -6,12 +6,14 @@ import { Button } from 'components/Button' import { ContractPageHeader } from 'components/ContractPageHeader' import { AddressInput } from 'components/forms/FormInput' import { useInputState } from 'components/forms/FormInput.hooks' -import Lister from 'components/Lister' +import type { AppConfig } from 'config' +import { getConfig } from 'config' import type { NextPage } from 'next' import { useRouter } from 'next/router' import { NextSeo } from 'next-seo' import { useEffect, useState } from 'react' import { toast } from 'react-hot-toast' +import { NETWORK } from 'utils/constants' import { withMetadata } from 'utils/layout' import { links } from 'utils/links' @@ -23,11 +25,11 @@ interface ConfigResponse { const CollectionQueriesPage: NextPage = () => { const [client, setClient] = useState() const [baseUri, SetBaseUri] = useState('') - const [doneList, setDoneList] = useState([]) - const [processList, setProcessList] = useState([]) + const [doneCount, setDoneCount] = useState(0) const [errorList, setErrorList] = useState([]) const [numTokens, setNumTokens] = useState(0) const [percentage, setPercentage] = useState('0.00') + const [isLoading, setIsLoading] = useState(false) const minterContractState = useInputState({ id: 'minter-contract-address', name: 'minter-contract-address', @@ -41,7 +43,8 @@ const CollectionQueriesPage: NextPage = () => { useEffect(() => { async function init() { - setClient(await CosmWasmClient.connect('https://rpc.elgafar-1.stargaze-apis.com/')) //'https://rpc.stargaze-apis.com/')) + const config: AppConfig = getConfig(NETWORK) + setClient(await CosmWasmClient.connect(config.rpcUrl)) } void init() }, []) @@ -55,8 +58,7 @@ const CollectionQueriesPage: NextPage = () => { setNumTokens(res.num_tokens) SetBaseUri(res.base_token_uri) setPercentage('0.00') - setDoneList([]) - setProcessList([]) + setDoneCount(0) setErrorList([]) } } @@ -75,9 +77,10 @@ const CollectionQueriesPage: NextPage = () => { }, []) useEffect(() => { - if (numTokens !== 0) setPercentage((((Math.round(100 * doneList.length) / numTokens) * 100) / 100).toFixed(2)) - else setPercentage('0') - }, [doneList.length, numTokens]) + if (doneCount === numTokens) setIsLoading(false) + if (numTokens !== 0) setPercentage(((doneCount / numTokens) * 100).toFixed(2)) + else setPercentage('0.00') + }, [doneCount, numTokens]) function chooseAlternate(url: string, attempt: number) { let alternate @@ -103,29 +106,19 @@ const CollectionQueriesPage: NextPage = () => { } async function warmOne(i: number, image: string, attempt: number, totalAttempt: number) { - setProcessList((existingItems) => { - return [i, ...existingItems] - }) const link = image.replace('1', i.toString()) try { const result = await axios.get(chooseAlternate(link, attempt)) if (result.status === 200) { - setDoneList((existingItems) => { - return [i, ...existingItems] - }) - setProcessList((existingItems) => { - const index = existingItems.indexOf(i, 0) - if (index > -1) { - existingItems.splice(index, 1) - } - return existingItems + setDoneCount((count) => { + return count + 1 }) return } } catch (e) { - console.log('error: ', i, e) + toast.error(e as string) } if (totalAttempt !== 4) { void warmOne(i, image, attempt === 3 ? 0 : attempt + 1, attempt === 3 ? totalAttempt + 1 : totalAttempt) @@ -133,30 +126,35 @@ const CollectionQueriesPage: NextPage = () => { setErrorList((existingItems) => { return [i, ...existingItems] }) - setProcessList((existingItems) => { - const index = existingItems.indexOf(i, 0) - if (index > -1) { - existingItems.splice(index, 1) - } - return existingItems + setDoneCount((count) => { + return count + 1 }) } } - async function warmingProcess(url: string, attempt: number) { + async function warmingProcess(url: string, attempt: number, err: boolean) { const link = `${chooseAlternate(url, attempt)}/1` try { const { data, status } = await axios.get(link) if (status === 200) { - for (let i = 1; i <= numTokens; i++) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access - void warmOne(i, data.image, 0, 0) + if (!err) { + for (let i = 1; i <= numTokens; i++) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access + void warmOne(i, data.image, 0, 0) + } + } else { + const list = errorList + setErrorList([]) + list.forEach((i) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access + void warmOne(i, data.image, 0, 0) + }) } } else if (attempt < 3) { - void warmingProcess(url, attempt + 1) + void warmingProcess(url, attempt + 1, err) } else toast.error('File can not be reachable at the moment! Please try again later...') } catch (e) { - console.log(e) + toast.error(e as string) } } @@ -175,37 +173,41 @@ const CollectionQueriesPage: NextPage = () => {
Total
-
Warmed
+
Done
+
Error
Percentage
{numTokens}
-
{doneList.length}
+
{doneCount}
+
{errorList.length}
{percentage}%
-
+
-
- {errorList.map((value: number, index: number) => { - return - })} -
) } From 55067c9256c1e5787995cfe754f259008aeb0567 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 1 Feb 2023 16:17:39 +0300 Subject: [PATCH 07/21] Update maintainer list --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b480a52..fd55930 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @findolor @MightOfOaks @name-user1 +* @MightOfOaks @name-user1 @Ninjatosba \ No newline at end of file From 12479437fd3a1cea49b43b86fa630b1e6c774024 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 1 Feb 2023 16:20:42 +0300 Subject: [PATCH 08/21] Update maintainer list - add new line --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index fd55930..d175b9e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @MightOfOaks @name-user1 @Ninjatosba \ No newline at end of file +* @MightOfOaks @name-user1 @Ninjatosba From 5a8dbcba4fa9a4aadc2ea8b6c4a2e2a0e28468b8 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 1 Feb 2023 16:22:15 +0300 Subject: [PATCH 09/21] Remove Lister.tsx --- components/Lister.tsx | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 components/Lister.tsx diff --git a/components/Lister.tsx b/components/Lister.tsx deleted file mode 100644 index aa12fc8..0000000 --- a/components/Lister.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react' - -export interface ListerProps { - data: string - key: string -} - -function Lister({ data, key }: ListerProps) { - return ( - - {key}-{data} - - ) -} - -// eslint-disable-next-line import/no-default-export -export default Lister From a3e54a29a351dddc6ead0f5710431185643396b1 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sat, 4 Feb 2023 10:47:38 +0300 Subject: [PATCH 10/21] Fix: Using an existing token URI triggers batch minting for 1/1 collections --- pages/collections/create.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index ecd8e03..69f7c2c 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -498,7 +498,7 @@ const CollectionCreationPage: NextPage = () => { setTransactionHash(data.transactionHash) setVendingMinterContractAddress(data.baseMinterAddress) setSg721ContractAddress(data.sg721Address) - if (uploadDetails?.assetFiles.length === 1) { + if (uploadDetails?.assetFiles.length === 1 || uploadDetails?.uploadMethod === 'existing') { await toast .promise( baseMinterContract.use(data.baseMinterAddress)?.mint(wallet.address, baseUri) as Promise, From dc2e0c421ef2752469d27e12c51f49e614306198 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sat, 4 Feb 2023 11:00:55 +0300 Subject: [PATCH 11/21] Remove withdraw{} from collection actions --- components/collections/actions/actions.ts | 18 ------------------ contracts/vendingMinter/messages/execute.ts | 8 -------- 2 files changed, 26 deletions(-) diff --git a/components/collections/actions/actions.ts b/components/collections/actions/actions.ts index fa65b27..98bff3f 100644 --- a/components/collections/actions/actions.ts +++ b/components/collections/actions/actions.ts @@ -22,7 +22,6 @@ export const ACTION_TYPES = [ 'update_per_address_limit', 'update_collection_info', 'freeze_collection_info', - 'withdraw', 'transfer', 'batch_transfer', 'burn', @@ -60,11 +59,6 @@ export const BASE_ACTION_LIST: ActionListItem[] = [ name: 'Freeze Collection Info', description: `Freeze collection info to prevent further updates`, }, - { - id: 'withdraw', - name: 'Withdraw Tokens', - description: `Withdraw tokens from the contract`, - }, { id: 'transfer', name: 'Transfer Tokens', @@ -153,11 +147,6 @@ export const VENDING_ACTION_LIST: ActionListItem[] = [ name: 'Freeze Collection Info', description: `Freeze collection info to prevent further updates`, }, - { - id: 'withdraw', - name: 'Withdraw Tokens', - description: `Withdraw tokens from the contract`, - }, { id: 'transfer', name: 'Transfer Tokens', @@ -224,7 +213,6 @@ export type DispatchExecuteArgs = { | { type: Select<'update_start_trading_time'>; startTime?: string } | { type: Select<'update_per_address_limit'>; limit: number } | { type: Select<'shuffle'> } - | { type: Select<'withdraw'> } | { type: Select<'transfer'>; recipient: string; tokenId: number } | { type: Select<'batch_transfer'>; recipient: string; tokenIds: string } | { type: Select<'burn'>; tokenId: number } @@ -284,9 +272,6 @@ export const dispatchExecute = async (args: DispatchExecuteArgs) => { case 'shuffle': { return vendingMinterMessages.shuffle(txSigner) } - case 'withdraw': { - return vendingMinterMessages.withdraw(txSigner) - } case 'transfer': { return sg721Messages.transferNft(args.recipient, args.tokenId.toString()) } @@ -365,9 +350,6 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => { case 'shuffle': { return vendingMinterMessages(minterContract)?.shuffle() } - case 'withdraw': { - return vendingMinterMessages(minterContract)?.withdraw() - } case 'transfer': { return sg721Messages(sg721Contract)?.transferNft(args.recipient, args.tokenId.toString()) } diff --git a/contracts/vendingMinter/messages/execute.ts b/contracts/vendingMinter/messages/execute.ts index 058ae73..391178f 100644 --- a/contracts/vendingMinter/messages/execute.ts +++ b/contracts/vendingMinter/messages/execute.ts @@ -14,7 +14,6 @@ export const EXECUTE_TYPES = [ 'mint_to', 'mint_for', 'shuffle', - 'withdraw', 'burn_remaining', ] as const @@ -106,7 +105,6 @@ export type DispatchExecuteArgs = { | { type: Select<'mint_to'>; recipient: string } | { type: Select<'mint_for'>; recipient: string; tokenId: number } | { type: Select<'shuffle'> } - | { type: Select<'withdraw'> } | { type: Select<'burn_remaining'> } ) @@ -146,9 +144,6 @@ export const dispatchExecute = async (args: DispatchExecuteArgs) => { case 'shuffle': { return messages.shuffle(txSigner) } - case 'withdraw': { - return messages.withdraw(txSigner) - } case 'burn_remaining': { return messages.burnRemaining(txSigner) } @@ -193,9 +188,6 @@ export const previewExecutePayload = (args: DispatchExecuteArgs) => { case 'shuffle': { return messages(contract)?.shuffle() } - case 'withdraw': { - return messages(contract)?.withdraw() - } case 'burn_remaining': { return messages(contract)?.burnRemaining() } From 5d888dd8d60496fae31fa0f271ea331287c50f47 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sat, 4 Feb 2023 11:10:06 +0300 Subject: [PATCH 12/21] Update minter instantiation error toast durations as 10s --- pages/collections/create.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index 69f7c2c..08edfb6 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -214,7 +214,7 @@ const CollectionCreationPage: NextPage = () => { setCreatingCollection(false) // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - toast.error(error.message, { style: { maxWidth: 'none' } }) + toast.error(error.message, { style: { maxWidth: 'none' }, duration: 10000 }) setCreatingCollection(false) setUploading(false) } @@ -276,7 +276,7 @@ const CollectionCreationPage: NextPage = () => { setCreatingCollection(false) // eslint-disable-next-line @typescript-eslint/no-explicit-any } catch (error: any) { - toast.error(error.message, { style: { maxWidth: 'none' } }) + toast.error(error.message, { style: { maxWidth: 'none' }, duration: 10000 }) setCreatingCollection(false) setUploading(false) } From 56e7986fbd430a5bd6535b58f16fa19b6a6ff62b Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sat, 4 Feb 2023 11:28:41 +0300 Subject: [PATCH 13/21] Metadata file count check prior to batch minting for 1/1 collections --- pages/collections/create.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index 08edfb6..1116be5 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -676,9 +676,14 @@ const CollectionCreationPage: NextPage = () => { if (!uploadDetails) { throw new Error('Please select assets and metadata') } - // if (minterType === 'base' && uploadDetails.uploadMethod === 'new' && uploadDetails.assetFiles.length > 1) { - // throw new Error('Base Minter can only mint one asset at a time. Please select only one asset.') - // } + if ( + minterType === 'base' && + uploadDetails.uploadMethod === 'new' && + uploadDetails.assetFiles.length > 1 && + uploadDetails.metadataFiles.length === 0 + ) { + throw new Error('Please select metadata files') + } if (uploadDetails.uploadMethod === 'new' && uploadDetails.assetFiles.length === 0) { throw new Error('Please select the assets') } From 59cbe7cb7335641e33147ff08826d9eba8ccc976 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sat, 4 Feb 2023 11:30:35 +0300 Subject: [PATCH 14/21] Bump Studio version --- .env.example | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 88228a6..0968b3e 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -APP_VERSION=0.4.2 +APP_VERSION=0.4.3 NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS NEXT_PUBLIC_SG721_CODE_ID=793 diff --git a/package.json b/package.json index 74d0a30..21e4d0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stargaze-studio", - "version": "0.4.2", + "version": "0.4.3", "workspaces": [ "packages/*" ], From 72670c7022d45cb8fb39050761f5968a92b46be2 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sun, 19 Feb 2023 10:45:53 +0300 Subject: [PATCH 15/21] Update IPFS Gateway for My Collections --- pages/collections/myCollections.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pages/collections/myCollections.tsx b/pages/collections/myCollections.tsx index 8cf77b6..d1f8a58 100644 --- a/pages/collections/myCollections.tsx +++ b/pages/collections/myCollections.tsx @@ -1,4 +1,5 @@ /* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ @@ -56,7 +57,13 @@ const CollectionList: NextPage = () => {
Cover
From d70903920d53c5e18a037daef7d61fa445ad50eb Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Sun, 19 Feb 2023 10:46:20 +0300 Subject: [PATCH 16/21] Bump Studio version --- .env.example | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 0968b3e..6219d01 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -APP_VERSION=0.4.3 +APP_VERSION=0.4.4 NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS NEXT_PUBLIC_SG721_CODE_ID=793 diff --git a/package.json b/package.json index 21e4d0d..c03cb4f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stargaze-studio", - "version": "0.4.3", + "version": "0.4.4", "workspaces": [ "packages/*" ], From 7a4460e9b9be68bd09d1f2a9a52cc11b654d5fa7 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 22 Feb 2023 20:52:00 +0300 Subject: [PATCH 17/21] Include Creator Income Dashboard link on the sidebar --- components/IncomeDashboardDisclaimer.tsx | 79 ++++++++++++++++++++++++ components/Sidebar.tsx | 70 ++++++++++++++------- 2 files changed, 127 insertions(+), 22 deletions(-) create mode 100644 components/IncomeDashboardDisclaimer.tsx diff --git a/components/IncomeDashboardDisclaimer.tsx b/components/IncomeDashboardDisclaimer.tsx new file mode 100644 index 0000000..5ecd53c --- /dev/null +++ b/components/IncomeDashboardDisclaimer.tsx @@ -0,0 +1,79 @@ +import { useRef, useState } from 'react' + +import { Button } from './Button' + +export interface IncomeDashboardDisclaimerProps { + creatorAddress: string +} +export const IncomeDashboardDisclaimer = (props: IncomeDashboardDisclaimerProps) => { + const [isChecked, setIsChecked] = useState(false) + const checkBoxRef = useRef(null) + + const handleCheckBox = () => { + checkBoxRef.current?.click() + } + + return ( +
+ + +
+ ) +} diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 5e44882..c479f64 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -1,3 +1,5 @@ +/* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable no-nested-ternary */ import clsx from 'clsx' import { Anchor } from 'components/Anchor' import { useWallet } from 'contexts/wallet' @@ -5,7 +7,8 @@ import { useRouter } from 'next/router' // import BrandText from 'public/brand/brand-text.svg' import { footerLinks, socialsLinks } from 'utils/links' -import { BASE_FACTORY_ADDRESS } from '../utils/constants' +import { BASE_FACTORY_ADDRESS, NETWORK } from '../utils/constants' +import { IncomeDashboardDisclaimer } from './IncomeDashboardDisclaimer' import { SidebarLayout } from './SidebarLayout' import { WalletLoader } from './WalletLoader' @@ -14,6 +17,7 @@ const routes = [ { text: 'Create a Collection', href: `/collections/create/`, isChild: true }, { text: 'My Collections', href: `/collections/myCollections/`, isChild: true }, { text: 'Collection Actions', href: `/collections/actions/`, isChild: true }, + { text: 'Creator Income Dashboard', href: `/collections/actions/`, isChild: true }, { text: 'Contract Dashboards', href: `/contracts/`, isChild: false }, { text: 'Base Minter Contract', href: `/contracts/baseMinter/`, isChild: true }, { text: 'Vending Minter Contract', href: `/contracts/vendingMinter/`, isChild: true }, @@ -40,27 +44,49 @@ export const Sidebar = () => { {/* wallet button */} {/* main navigation routes */} - {tempRoutes.map(({ text, href, isChild }) => ( - - {text} - - ))} + {tempRoutes.map(({ text, href, isChild }) => + text !== 'Creator Income Dashboard' ? ( + + {text === 'Creator Income Dashboard' &&
{text}
} + {text} +
+ ) : NETWORK === 'mainnet' ? ( + + ) : null, + )} + +
From e8175c3da2f0aded8a63cc40f7a5132759efed17 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Wed, 22 Feb 2023 20:57:51 +0300 Subject: [PATCH 18/21] Update disclaimer modal ID --- components/IncomeDashboardDisclaimer.tsx | 6 +++--- components/Sidebar.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/IncomeDashboardDisclaimer.tsx b/components/IncomeDashboardDisclaimer.tsx index 5ecd53c..d45754d 100644 --- a/components/IncomeDashboardDisclaimer.tsx +++ b/components/IncomeDashboardDisclaimer.tsx @@ -15,8 +15,8 @@ export const IncomeDashboardDisclaimer = (props: IncomeDashboardDisclaimerProps) return (
- -