diff --git a/src/components/project-card/ProjectCardAlt.tsx b/src/components/project-card/ProjectCardAlt.tsx index 357e9c3928..f96273ba93 100644 --- a/src/components/project-card/ProjectCardAlt.tsx +++ b/src/components/project-card/ProjectCardAlt.tsx @@ -8,6 +8,7 @@ import { } from '@giveth/ui-design-system'; import styled from 'styled-components'; import { useIntl } from 'react-intl'; +import Link from 'next/link'; import ProjectCardImage from './ProjectCardImage'; import ProjectCardOrgBadge from './ProjectCardOrgBadge'; import { IProject } from '@/apollo/types/types'; @@ -50,9 +51,9 @@ const ProjectCard = (props: IProjectCard) => { return ( - + - + = ({ image }) => { src={src!} fill alt='project image' - onError={() => setSrc(undefined)} + onError={() => setSrc('/images/backgrounds/project-bg.png')} loading='lazy' /> ); diff --git a/src/components/views/project/ProjectIndex.tsx b/src/components/views/project/ProjectIndex.tsx index 6a9d87c093..6c8be08012 100644 --- a/src/components/views/project/ProjectIndex.tsx +++ b/src/components/views/project/ProjectIndex.tsx @@ -11,7 +11,6 @@ import { } from '@giveth/ui-design-system'; import styled from 'styled-components'; import { Col, Row } from '@giveth/ui-design-system'; - import { useIntl } from 'react-intl'; import { Flex } from '@/components/styled-components/Flex'; import ProjectHeader from './ProjectHeader'; diff --git a/src/lib/helpers.ts b/src/lib/helpers.ts index 9057cc0a6c..4daa764d26 100644 --- a/src/lib/helpers.ts +++ b/src/lib/helpers.ts @@ -1,17 +1,15 @@ import { promisify } from 'util'; // eslint-disable-next-line import/named import unescape from 'lodash/unescape'; - import { parseEther, parseUnits } from '@ethersproject/units'; import { keccak256 } from '@ethersproject/keccak256'; import { Contract } from '@ethersproject/contracts'; import { TransactionResponse, Web3Provider } from '@ethersproject/providers'; import { AddressZero } from '@ethersproject/constants'; -import { brandColors } from '@giveth/ui-design-system'; // @ts-ignore import abi from 'human-standard-token-abi'; - import { captureException } from '@sentry/nextjs'; +import { brandColors } from '@giveth/ui-design-system'; import { BasicNetworkConfig, GasPreference } from '@/types/config'; import { EWallets } from '@/lib/wallet/walletTypes'; import { giveconomyTabs } from '@/lib/constants/Tabs'; @@ -225,8 +223,7 @@ export const noImgColor = () => noImgColors[Math.floor(Math.random() * 3)]; export const noImgIcon = '/images/GIV-icon-text.svg'; -export const isNoImg = (image: string | undefined) => - !(image && !Number(image)); +export const isNoImg = (image: string | undefined) => !image || image === ''; export const shortenAddress = ( address: string | null | undefined,