Skip to content

Commit

Permalink
Merge pull request #3024 from Giveth/bug-in-donation-page-for-project…
Browse files Browse the repository at this point in the history
…-with-default-cover

Bug in donation page for project with default cover
  • Loading branch information
MohammadPCh authored Aug 13, 2023
2 parents 2d75845 + d12df33 commit 55930f2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/components/project-card/ProjectCardAlt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -50,9 +51,9 @@ const ProjectCard = (props: IProjectCard) => {
return (
<Wrapper isNew={isNew}>
<ImagePlaceholder>
<InternalLink href={slugToProjectView(slug)}>
<Link href={slugToProjectView(slug)}>
<ProjectCardImage image={image} />
</InternalLink>
</Link>
</ImagePlaceholder>
<ProjectCardOrgBadge
organization={orgLabel}
Expand Down
2 changes: 1 addition & 1 deletion src/components/project-card/ProjectCardImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const ProjectCardImage: FC<IProjectCardImageProps> = ({ image }) => {
src={src!}
fill
alt='project image'
onError={() => setSrc(undefined)}
onError={() => setSrc('/images/backgrounds/project-bg.png')}
loading='lazy'
/>
);
Expand Down
1 change: 0 additions & 1 deletion src/components/views/project/ProjectIndex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
7 changes: 2 additions & 5 deletions src/lib/helpers.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 55930f2

Please sign in to comment.