diff --git a/.env.example b/.env.example index 90d63f5..b9a4f58 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -APP_VERSION=0.6.8 +APP_VERSION=0.6.9 NEXT_PUBLIC_PINATA_ENDPOINT_URL=https://api.pinata.cloud/pinning/pinFileToIPFS NEXT_PUBLIC_SG721_CODE_ID=2595 @@ -32,4 +32,5 @@ NEXT_PUBLIC_BLOCK_EXPLORER_URL=https://testnet-explorer.publicawesome.dev/starga NEXT_PUBLIC_NETWORK=testnet NEXT_PUBLIC_STARGAZE_WEBSITE_URL=https://testnet.publicawesome.dev NEXT_PUBLIC_BADGES_URL=https://badges.publicawesome.dev -NEXT_PUBLIC_WEBSITE_URL=https:// \ No newline at end of file +NEXT_PUBLIC_WEBSITE_URL=https:// +NEXT_PUBLIC_SYNC_COLLECTIONS_API_URL="https://..." \ No newline at end of file diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 1c0df60..933fd93 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -38,13 +38,13 @@ export const Sidebar = () => { {/* Stargaze brand as home button */} [e.preventDefault(), router.push('/brand')]}> - Brand Text + Brand Text {/* wallet button */} {/* main navigation routes */} -
+
  • { {/* footer attribution */}
    Stargaze Studio {process.env.APP_VERSION}
    - Made by{' '} - - deus labs + Powered by{' '} + + Stargaze
    diff --git a/components/WalletLoader.tsx b/components/WalletLoader.tsx index 57ba343..c331398 100644 --- a/components/WalletLoader.tsx +++ b/components/WalletLoader.tsx @@ -16,7 +16,7 @@ export const WalletLoader = () => { const displayName = useWalletStore((store) => store.name || getShortAddress(store.address)) return ( - + {({ close }) => ( <>
    diff --git a/env.d.ts b/env.d.ts index bd52325..955e661 100644 --- a/env.d.ts +++ b/env.d.ts @@ -45,6 +45,7 @@ declare namespace NodeJS { readonly NEXT_PUBLIC_NETWORK: string readonly NEXT_PUBLIC_STARGAZE_WEBSITE_URL: string readonly NEXT_PUBLIC_WEBSITE_URL: string + readonly NEXT_PUBLIC_SYNC_COLLECTIONS_API_URL: string } } diff --git a/package.json b/package.json index 7ea8c9b..89b8e9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stargaze-studio", - "version": "0.6.8", + "version": "0.6.9", "workspaces": [ "packages/*" ], diff --git a/pages/collections/create.tsx b/pages/collections/create.tsx index 2f6e2ab..f13280e 100644 --- a/pages/collections/create.tsx +++ b/pages/collections/create.tsx @@ -9,6 +9,7 @@ import { toUtf8 } from '@cosmjs/encoding' import { coin } from '@cosmjs/proto-signing' import { Sidetab } from '@typeform/embed-react' +import axios from 'axios' import clsx from 'clsx' import { Alert } from 'components/Alert' import { Anchor } from 'components/Anchor' @@ -41,7 +42,7 @@ import type { DispatchExecuteArgs as VendingFactoryDispatchExecuteArgs } from 'c import { dispatchExecute as vendingFactoryDispatchExecute } from 'contracts/vendingFactory/messages/execute' import type { NextPage } from 'next' import { NextSeo } from 'next-seo' -import { useEffect, useMemo, useRef, useState } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react' import { toast } from 'react-hot-toast' import { upload } from 'services/upload' import { compareFileArrays } from 'utils/compareFileArrays' @@ -55,6 +56,7 @@ import { SG721_CODE_ID, SG721_UPDATABLE_CODE_ID, STARGAZE_URL, + SYNC_COLLECTIONS_API_URL, VENDING_FACTORY_ADDRESS, VENDING_FACTORY_FLEX_ADDRESS, VENDING_FACTORY_UPDATABLE_ADDRESS, @@ -81,6 +83,7 @@ const CollectionCreationPage: NextPage = () => { baseFactory: baseFactoryContract, } = useContracts() const scrollRef = useRef(null) + const sidetabRef = useRef(null) const vendingFactoryMessages = useMemo( () => vendingFactoryContract?.use(VENDING_FACTORY_ADDRESS), @@ -1102,14 +1105,45 @@ const CollectionCreationPage: NextPage = () => { ) } } + + const syncCollections = useCallback(async () => { + const collectionAddress = + minterType === 'openEdition' ? openEditionMinterDetails?.sg721ContractAddress : sg721ContractAddress + if (collectionAddress && SYNC_COLLECTIONS_API_URL) { + await axios.get(`${SYNC_COLLECTIONS_API_URL}/${collectionAddress}`).catch((error) => { + console.error('Sync collections: ', error) + }) + } + }, [minterType, openEditionMinterDetails?.sg721ContractAddress, sg721ContractAddress]) + useEffect(() => { if ( vendingMinterContractAddress !== null || openEditionMinterDetails?.openEditionMinterContractAddress || isMintingComplete - ) + ) { scrollRef.current?.scrollIntoView({ behavior: 'smooth' }) - }, [vendingMinterContractAddress, openEditionMinterDetails?.openEditionMinterContractAddress, isMintingComplete]) + } + if ( + (minterType === 'vending' && vendingMinterContractAddress !== null) || + (minterType === 'openEdition' && openEditionMinterDetails?.openEditionMinterContractAddress) || + (minterType === 'base' && vendingMinterContractAddress !== null && isMintingComplete) + ) { + void syncCollections() + if (sidetabRef.current) { + setTimeout(() => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call + sidetabRef.current.open() + }, 3000) + } + } + }, [ + vendingMinterContractAddress, + openEditionMinterDetails?.openEditionMinterContractAddress, + isMintingComplete, + minterType, + syncCollections, + ]) useEffect(() => { setBaseTokenUri(uploadDetails?.baseTokenURI as string) @@ -1600,7 +1634,14 @@ const CollectionCreationPage: NextPage = () => { Mint & Add Token(s) - +
diff --git a/pages/home.tsx b/pages/home.tsx new file mode 100644 index 0000000..dddead4 --- /dev/null +++ b/pages/home.tsx @@ -0,0 +1,53 @@ +import { Conditional } from 'components/Conditional' +import { HomeCard } from 'components/HomeCard' +import type { NextPage } from 'next' +import { BADGE_HUB_ADDRESS } from 'utils/constants' +import { withMetadata } from 'utils/layout' + +const HomePage: NextPage = () => { + return ( +
+
+ Brand Text +
+

Welcome!

+

+ Looking for a fast and efficient way to build an NFT collection? Stargaze Studio is the solution. +
+
+ Stargaze Studio is built to provide useful smart contract interfaces that help you build and deploy your own NFT + collections in no time. +

+ +
+ +
+ +
+ + Create a collection, view a list of your collections or execute collection actions and queries. + + + + Create badges, view a list of them or execute badge related actions and queries. + + + + Execute actions and queries for a variety of contracts. + +
+
+ ) +} + +export default withMetadata(HomePage, { center: false }) diff --git a/pages/index.tsx b/pages/index.tsx index 22c0ac6..956fee2 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -6,33 +6,27 @@ import { withMetadata } from 'utils/layout' const HomePage: NextPage = () => { return ( -
-
- Brand Text -
-

Welcome!

-

- Looking for a fast and efficient way to build an NFT collection? Stargaze Studio is the solution. -
-
- Stargaze Studio is built to provide useful smart contract interfaces that help you build and deploy your own NFT - collections in no time. -

- -
- -
- -
- +
+
+ Create a collection, view a list of your collections or execute collection actions and queries. - + Create badges, view a list of them or execute badge related actions and queries. - + Execute actions and queries for a variety of contracts.
diff --git a/public/studio-logo.png b/public/studio-logo.png new file mode 100644 index 0000000..60a408e Binary files /dev/null and b/public/studio-logo.png differ diff --git a/utils/constants.ts b/utils/constants.ts index 212c589..097aefa 100644 --- a/utils/constants.ts +++ b/utils/constants.ts @@ -30,7 +30,6 @@ export const PINATA_ENDPOINT_URL = process.env.NEXT_PUBLIC_PINATA_ENDPOINT_URL export const NETWORK = process.env.NEXT_PUBLIC_NETWORK export const API_URL = process.env.NEXT_PUBLIC_API_URL export const STARGAZE_URL = process.env.NEXT_PUBLIC_STARGAZE_WEBSITE_URL - export const BLOCK_EXPLORER_URL = process.env.NEXT_PUBLIC_BLOCK_EXPLORER_URL - export const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL +export const SYNC_COLLECTIONS_API_URL = process.env.NEXT_PUBLIC_SYNC_COLLECTIONS_API_URL diff --git a/utils/links.ts b/utils/links.ts index ec8c165..5e6224e 100644 --- a/utils/links.ts +++ b/utils/links.ts @@ -1,26 +1,27 @@ import { ImGithub, ImTwitter } from 'react-icons/im' import { SiDiscord, SiTelegram } from 'react-icons/si' -import { BLOCK_EXPLORER_URL } from './constants' +import { BLOCK_EXPLORER_URL, NETWORK } from './constants' export const links = { // main links - deuslabs: `https://deuslabs.fi`, Discord: `https://discord.gg/stargaze`, Docs: `https://docs.stargaze.zone/guides/stargaze-studio`, GitHub: `https://github.com/public-awesome/stargaze-studio`, - Stargaze: `https://stargaze.zone/`, + Survey: `https://stargaze-zone.typeform.com/studiosurvey`, Telegram: `https://t.me/joinchat/ZQ95YmIn3AI0ODFh`, Twitter: `https://twitter.com/stargazezone`, Explorer: BLOCK_EXPLORER_URL, Documentation: 'https://docs.stargaze.zone/guides/stargaze-studio', + Switch: `${NETWORK === 'mainnet' ? 'https://studio.publicawesome.dev' : 'https://studio.stargaze.zone'}`, } export const footerLinks = [ + { text: `Switch to ${NETWORK === 'mainnet' ? 'Testnet' : 'Mainnet'}`, href: links.Switch }, { text: 'Block Explorer', href: links.Explorer }, { text: 'Documentation', href: links.Docs }, { text: 'Submit an issue', href: `${links.GitHub}/issues/new` }, - { text: 'Powered by Stargaze', href: links.Stargaze }, + { text: 'Studio Survey', href: links.Survey }, ] export const socialsLinks = [