Skip to content

Commit 1921c98

Browse files
committed
refactor: ignore grant items without url
1 parent 7281143 commit 1921c98

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/grants/components/grant-card/full-grant-card.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export const FullGrantCard = ({ grant, isRounded = true }: Props) => {
3535
hasWebLinks,
3636
} = getGrantCardData(grant);
3737

38+
if (!url) return null;
39+
3840
return (
3941
<div
4042
className={cn(

src/grants/components/grant-list/grant-list-item.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export const GrantListItem = ({ grant, isLink = true, isInfo }: Props) => {
3535
hasWebLinks,
3636
} = getGrantCardData(grant);
3737

38+
if (!url) return null;
39+
3840
const wrapperClassName =
3941
'flex flex-wrap items-center justify-between rounded-2xl bg-gradient-to-r from-[#191919] to-[#0D0D0D] p-4 text-13 text-white transition-all duration-300 md:p-5 lg:flex-nowrap';
4042

src/grants/utils/dto-to-grant.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ export const dtoToGrant = (dto: GrantDto): Grant => {
2828
// TODO: where to get this? { text: string, logo: string }[]
2929
reputations: [],
3030
logo: metadata?.logoImg ?? null,
31-
url:
32-
metadata?.website ??
33-
socialLinks?.website ??
34-
socialLinks?.orgWebsite ??
35-
null,
31+
url: socialLinks?.grantsSite || socialLinks?.orgWebsite || null,
3632
twitter: socialLinks?.twitter ?? null,
3733
discord: socialLinks?.discord ?? null,
3834
granteesCount: metadata?.grantsToDate ?? 0,

0 commit comments

Comments
 (0)