From 6e4487ed644c65166310651029c503e9c1c2829a Mon Sep 17 00:00:00 2001 From: Ramin Date: Tue, 8 Aug 2023 14:59:42 +0330 Subject: [PATCH 1/4] remove unused break --- src/components/views/project/ProjectIndex.tsx | 1 - 1 file changed, 1 deletion(-) 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'; From 3d4bfcced906f038f7e7f7a3b7dcfecb098e6f52 Mon Sep 17 00:00:00 2001 From: Ramin Date: Tue, 8 Aug 2023 15:00:14 +0330 Subject: [PATCH 2/4] add error image to ProjectCardImage.tsx --- src/components/project-card/ProjectCardImage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/project-card/ProjectCardImage.tsx b/src/components/project-card/ProjectCardImage.tsx index 0cc89b887e..f457795fea 100644 --- a/src/components/project-card/ProjectCardImage.tsx +++ b/src/components/project-card/ProjectCardImage.tsx @@ -17,7 +17,7 @@ const ProjectCardImage: FC = ({ image }) => { src={src!} fill alt='project image' - onError={() => setSrc(undefined)} + onError={() => setSrc('/images/backgrounds/project-bg.png')} loading='lazy' /> ); From 0204b4104367992e516b94e7a6856db1a60c58ee Mon Sep 17 00:00:00 2001 From: Ramin Date: Tue, 8 Aug 2023 15:00:35 +0330 Subject: [PATCH 3/4] remove inline display --- src/components/project-card/ProjectCardAlt.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 ( - + - + Date: Tue, 8 Aug 2023 15:01:25 +0330 Subject: [PATCH 4/4] fix no image checking --- src/lib/helpers.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/helpers.ts b/src/lib/helpers.ts index 5f908de3f8..d0c44ca6db 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,