From dd0b90eb84bac7ae148fb57575e6b3ee014b65de Mon Sep 17 00:00:00 2001 From: Charles Garrett Date: Wed, 2 Aug 2023 18:57:42 +0000 Subject: [PATCH] chore: replace wombi with a link to search analytics dapps in BOS --- frontend/pages/project-analytics.tsx | 93 +++--------------------- frontend/tutorials/nfts/md/2-minting.mdx | 2 - 2 files changed, 10 insertions(+), 85 deletions(-) diff --git a/frontend/pages/project-analytics.tsx b/frontend/pages/project-analytics.tsx index aa5e29bb..06c6f3b4 100644 --- a/frontend/pages/project-analytics.tsx +++ b/frontend/pages/project-analytics.tsx @@ -1,84 +1,14 @@ -import type { Api } from '@pc/common/types/api'; -import { iframeResizer } from 'iframe-resizer'; -import Link from 'next/link'; -import { useEffect, useRef } from 'react'; - import { ButtonLink } from '@/components/lib/Button'; import { Container } from '@/components/lib/Container'; -import { FeatherIcon } from '@/components/lib/FeatherIcon'; import { Flex } from '@/components/lib/Flex'; import { H1 } from '@/components/lib/Heading'; import { Section } from '@/components/lib/Section'; -import { Spinner } from '@/components/lib/Spinner'; import { Text } from '@/components/lib/Text'; -import { TextLink } from '@/components/lib/TextLink'; -import { useContracts } from '@/hooks/contracts'; -import { usePublicOrPrivateContracts } from '@/hooks/contracts'; -import { useCurrentEnvironment } from '@/hooks/environments'; import { useDashboardLayout } from '@/hooks/layouts'; -import { useSelectedProject } from '@/hooks/selected-project'; -import { useTheme } from '@/hooks/theme'; -import config from '@/utils/config'; import { StableId } from '@/utils/stable-ids'; import type { NextPageWithLayout } from '@/utils/types'; const ProjectAnalytics: NextPageWithLayout = () => { - const { project } = useSelectedProject(); - const { environment } = useCurrentEnvironment(); - const { contracts: privateContracts } = useContracts(project?.slug, environment?.subId); - const { contracts } = usePublicOrPrivateContracts(privateContracts); - - if (!environment || !contracts) { - return ; - } - - if (contracts.length === 0) { - return ; - } - - return ( -
- -
- ); -}; - -type Environment = Api.Query.Output<'/projects/getEnvironments'>[number]; -type Project = Api.Query.Output<'/projects/getContracts'>; - -function AnalyticsIframe({ environment, contracts }: { environment: Environment; contracts: Project }) { - const { activeTheme } = useTheme(); - const iframeId = 'analytics-iframe'; - const initialized = useRef(false); - - useEffect(() => { - if (!initialized.current) { - iframeResizer({}, `#${iframeId}`); - initialized.current = true; - } - }, []); - - const themeParam = activeTheme === 'dark' ? '#theme=night' : ''; - let contractParams = ''; - contracts.forEach((contract) => { - contractParams += `&contract=${contract.address}`; - }); - const iframeUrl = `${config.analyticsIframeUrl[environment.net]}?${contractParams}${themeParam}`; - - return ( - - ); -} - -function NoContractsNotice() { return (
@@ -86,24 +16,21 @@ function NoContractsNotice() {

Analytics

- Your selected project and environment doesn't have any saved contracts yet. Visit the{' '} - - Contracts - {' '} - page to add a contract. - - - - - - Contracts + Pagoda Console Analytics has been deprecated in favor of the ecosystem of apps in Near‘s Blockchain + Operating System
+ + Search Analytics d.Apps - +
); -} +}; ProjectAnalytics.getLayout = useDashboardLayout; diff --git a/frontend/tutorials/nfts/md/2-minting.mdx b/frontend/tutorials/nfts/md/2-minting.mdx index b8975b99..85060df2 100644 --- a/frontend/tutorials/nfts/md/2-minting.mdx +++ b/frontend/tutorials/nfts/md/2-minting.mdx @@ -278,8 +278,6 @@ Input the contract's account name (the `$NFT_CONTRACT_ID`) and click the Add but -You can also view these metrics in [the Developer Console Analytics screen](/project-analytics). Now we'll see how to verify these details through the CLI. - ### Viewing the contract's metadata Now that the contract has been initialized, you can call some of the functions you wrote earlier. More specifically, let's test out the function that returns the contract's metadata: