diff --git a/next.config.js b/next.config.js index 7cef82c841..52cd32f8de 100644 --- a/next.config.js +++ b/next.config.js @@ -7,10 +7,8 @@ const { withSentryConfig } = require('@sentry/nextjs'); const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true', }); -var pjson = require('./package.json'); -const generateRobotsTxt = require('./scripts/generate-robots-txt'); -const isProduction = process.env.NEXT_PUBLIC_ENV === 'production'; +const generateRobotsTxt = require('./scripts/generate-robots-txt'); const defaultLocale = 'en'; const locales = ['ca', 'en', 'es']; diff --git a/pages/landings/ethdenver.tsx b/pages/landings/ethdenver.tsx index fd10a3eaf1..b8b40d5581 100644 --- a/pages/landings/ethdenver.tsx +++ b/pages/landings/ethdenver.tsx @@ -2,8 +2,6 @@ import Head from 'next/head'; import { GetStaticProps } from 'next'; import { FC } from 'react'; import EthDenverView from '@/components/views/landings/EthDenver'; -import { FETCH_CAMPAIGN_BY_SLUG } from '@/apollo/gql/gqlCampaign'; -import { client } from '@/apollo/apolloClient'; import { ICampaign } from '@/apollo/types/types'; export interface IEthDenverProps { @@ -23,18 +21,22 @@ const EthDenverRoute: FC = ({ campaign }) => { export const getStaticProps: GetStaticProps = async () => { try { - const { data } = await client.query({ - query: FETCH_CAMPAIGN_BY_SLUG, - variables: { - slug: 'ethDenver', - }, - fetchPolicy: 'no-cache', - }); + //The campaign in not active + // const { data } = await client.query({ + // query: FETCH_CAMPAIGN_BY_SLUG, + // variables: { + // slug: 'ethDenver', + // }, + // fetchPolicy: 'no-cache', + // }); + // return { + // props: { + // campaign: data.findCampaignBySlug, + // }, + // revalidate: 600, + // }; return { - props: { - campaign: data.findCampaignBySlug, - }, - revalidate: 600, + props: {}, }; } catch (error) { return { diff --git a/pages/test2.tsx b/pages/test2.tsx index a7ec5e24fe..c9256c9843 100644 --- a/pages/test2.tsx +++ b/pages/test2.tsx @@ -31,8 +31,6 @@ const YourApp = () => { })), }); - console.log('subgraphValues', subgraphValues); - // Solana wallet hooks const { publicKey, diff --git a/src/apollo/apolloClient.ts b/src/apollo/apolloClient.ts index a40a3ff0cb..6bf978265c 100644 --- a/src/apollo/apolloClient.ts +++ b/src/apollo/apolloClient.ts @@ -1,7 +1,6 @@ import { useMemo } from 'react'; import { ApolloClient, InMemoryCache, ApolloLink } from '@apollo/client'; import { RetryLink } from '@apollo/client/link/retry'; - import { setContext } from '@apollo/client/link/context'; import { onError } from '@apollo/client/link/error'; import gql from 'graphql-tag'; @@ -95,7 +94,7 @@ function createApolloClient() { const httpLink = createUploadLink({ uri: config.BACKEND_LINK, fetch: customFetch as any, - }) as unknown as ApolloLink; + }); const authLink = setContext((_, { headers }) => { let locale: string | null = !ssrMode @@ -149,9 +148,12 @@ function createApolloClient() { } }); + // Combine all links using ApolloLink.from to fix terminating link error + const link = ApolloLink.from([errorLink, authLink, retryLink, httpLink]); + return new ApolloClient({ ssrMode, - link: errorLink.concat(authLink.concat(httpLink.concat(retryLink))), + link: link, cache: new InMemoryCache({ addTypename: false, }), @@ -161,7 +163,6 @@ function createApolloClient() { }, query: { fetchPolicy: 'cache-first', - // nextFetchPolicy: 'cache-first', }, }, typeDefs: gql` diff --git a/src/components/cards/MintCard.tsx b/src/components/cards/MintCard.tsx index 52409ebb5b..cc91527a38 100644 --- a/src/components/cards/MintCard.tsx +++ b/src/components/cards/MintCard.tsx @@ -18,13 +18,15 @@ import { readContracts, readContract } from '@wagmi/core'; import { MintModal } from '../modals/Mint/MintModal'; import { formatWeiHelper } from '@/helpers/number'; import config from '@/configuration'; -import { abi as PFP_ABI } from '@/artifacts/pfpGiver.json'; +import PFP_ARTIFACTS from '@/artifacts/pfpGiver.json'; import { InsufficientFundModal } from '../modals/InsufficientFund'; import { usePFPMintData } from '@/context/pfpmint.context'; import { useGeneralWallet } from '@/providers/generalWalletProvider'; import { wagmiConfig } from '@/wagmiConfigs'; import { getReadContractResult } from '@/lib/contracts'; + const MIN_NFT_QTY = 1; +const PFP_ABI = PFP_ARTIFACTS.abi as Abi; interface IpfpContractData { price: bigint; @@ -71,7 +73,7 @@ export const MintCard = () => { const baseParams = { address: config.MAINNET_CONFIG.PFP_CONTRACT_ADDRESS, chainId: config.MAINNET_NETWORK_NUMBER, - abi: PFP_ABI as Abi, + abi: PFP_ABI, } as const; const result = await readContracts(wagmiConfig, { contracts: [ @@ -121,7 +123,7 @@ export const MintCard = () => { const _balanceOf = await readContract(wagmiConfig, { address: config.MAINNET_CONFIG.PFP_CONTRACT_ADDRESS, chainId: config.MAINNET_NETWORK_NUMBER, - abi: PFP_ABI as Abi, + abi: PFP_ABI, functionName: 'balanceOf', args: [walletAddress], }); diff --git a/src/components/modals/Mint/MintModal.tsx b/src/components/modals/Mint/MintModal.tsx index 52dd4131eb..e86ec68bf2 100644 --- a/src/components/modals/Mint/MintModal.tsx +++ b/src/components/modals/Mint/MintModal.tsx @@ -10,6 +10,7 @@ import { } from '@giveth/ui-design-system'; import { useAccount } from 'wagmi'; import { writeContract } from '@wagmi/core'; +import { Abi } from 'viem'; import { IModal } from '@/types/common'; import { Modal } from '../Modal'; import { useModalAnimation } from '@/hooks/useModalAnimation'; @@ -18,16 +19,19 @@ import { formatWeiHelper } from '@/helpers/number'; import { waitForTransaction } from '@/lib/transaction'; import { approveERC20tokenTransfer } from '@/lib/stakingPool'; import config from '@/configuration'; -import { abi as PFP_ABI } from '@/artifacts/pfpGiver.json'; +import PFP_ARTIFACTS from '@/artifacts/pfpGiver.json'; + import { EPFPMinSteps, usePFPMintData } from '@/context/pfpmint.context'; import { MintSteps } from './MintSteps'; import { wagmiConfig } from '@/wagmiConfigs'; + export enum MintStep { APPROVE, APPROVING, MINT, MINTING, } +const PFP_ABI = PFP_ARTIFACTS.abi as Abi; interface IMintModalProps extends IModal { qty: number; diff --git a/src/components/views/nft/overview/CheckEligibility.tsx b/src/components/views/nft/overview/CheckEligibility.tsx index dd07905c50..e4fe64d194 100644 --- a/src/components/views/nft/overview/CheckEligibility.tsx +++ b/src/components/views/nft/overview/CheckEligibility.tsx @@ -11,14 +11,16 @@ import { import React, { ChangeEvent, useState } from 'react'; import styled from 'styled-components'; import { useAccount, useSwitchChain } from 'wagmi'; -import { Address } from 'viem'; +import { Abi, Address } from 'viem'; import { readContract } from '@wagmi/core'; -import { abi as PFP_ABI } from '@/artifacts/pfpGiver.json'; +import PFP_ARTIFACTS from '@/artifacts/pfpGiver.json'; import config from '@/configuration'; import { getAddressFromENS, isAddressENS } from '@/lib/wallet'; import EligibilityModal from './EligibilityModal'; import { wagmiConfig } from '@/wagmiConfigs'; +const PFP_ABI = PFP_ARTIFACTS.abi as Abi; + const CheckEligibility = () => { const [walletAddress, setWalletAddress] = useState(''); const [error, setError] = useState('');