Skip to content

Commit 5884d4f

Browse files
fix readonly bug (#15)
1 parent 6888888 commit 5884d4f

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.changeset/dirty-donkeys-live.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@gitcoin/ui": patch
3+
---
4+
5+
fix read only error

packages/ui/src/features/pool/components/PoolCard/PoolCard.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const NoLogo: Story = {
7171
args: {
7272
queryResult: createQueryState("success", {
7373
...simpleRound,
74-
logoImg: undefined,
74+
logoImg: "https://gateway.pinata.cloud/ipfs/undefined",
7575
}),
7676
},
7777
};

packages/ui/src/features/pool/components/PoolCard/PoolDataCard.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ export interface PoolDataCardProps {
1515
export function PoolDataCard({ data }: PoolDataCardProps) {
1616
const { name, icon } = getChainInfo(data.chainId);
1717

18-
if (data.logoImg === undefined || data.logoImg?.endsWith("undefined")) {
19-
data.logoImg = DefaultLogo;
20-
}
18+
const logoImg =
19+
data.logoImg === undefined || data.logoImg?.endsWith("undefined") ? DefaultLogo : data.logoImg;
2120

2221
return (
2322
<div
@@ -30,7 +29,7 @@ export function PoolDataCard({ data }: PoolDataCardProps) {
3029
className="inline-flex h-60 w-full cursor-pointer items-center justify-between rounded-2xl border border-grey-100 p-6"
3130
>
3231
<div className="flex items-center justify-start gap-6">
33-
<img className="relative size-48 rounded-2xl" src={data.logoImg} />
32+
<img className="relative size-48 rounded-2xl" src={logoImg} />
3433
<div className="inline-flex w-[482px] flex-col items-start justify-start gap-3">
3534
<div className="self-stretch text-2xl font-medium">{data.roundName}</div>
3635
<IconLabel

0 commit comments

Comments
 (0)