Skip to content

Commit e551d15

Browse files
committed
fix: border image
1 parent 881c37e commit e551d15

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

apps/frontend/src/components/new-launch/picks.socials.component.tsx

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { useLaunchStore } from '@gitroom/frontend/components/new-launch/store';
77
import { useShallow } from 'zustand/react/shallow';
88
import { useExistingData } from '@gitroom/frontend/components/launches/helpers/use.existing.data';
99
import { makeId } from '@gitroom/nestjs-libraries/services/make.is';
10+
import ImageWithFallback from '@gitroom/react/helpers/image.with.fallback';
1011

1112
export const PicksSocialsComponent: FC<{ toolTip?: boolean }> = ({
1213
toolTip,
@@ -64,28 +65,24 @@ export const PicksSocialsComponent: FC<{ toolTip?: boolean }> = ({
6465
: 'border-[#622FF6]'
6566
)}
6667
>
67-
<div
68-
className="rounded-full min-w-[42px] min-h-[42px] bg-contain bg-center bg-no-repeat"
69-
style={{ backgroundImage: `url(/no-picture.jpg)` }}
70-
>
71-
<Image
72-
src={integration.picture || '/no-picture.jpg'}
73-
className={clsx(
74-
'rounded-full transition-all min-w-[42px] border-[1.5px] min-h-[42px]',
75-
selectedIntegrations.findIndex(
76-
(p) => p.integration.id === integration.id
77-
) === -1
78-
? 'border-transparent'
79-
: 'border-[#000]'
80-
)}
81-
onError={(e) => {
82-
e.currentTarget.style.display = 'none';
83-
}}
84-
alt={integration.identifier}
85-
width={42}
86-
height={42}
87-
/>
88-
</div>
68+
<ImageWithFallback
69+
fallbackSrc="/no-picture.jpg"
70+
src={integration.picture || '/no-picture.jpg'}
71+
className={clsx(
72+
'rounded-full transition-all min-w-[42px] border-[1.5px] min-h-[42px]',
73+
selectedIntegrations.findIndex(
74+
(p) => p.integration.id === integration.id
75+
) === -1
76+
? 'border-transparent'
77+
: 'border-[#000]'
78+
)}
79+
onError={(e) => {
80+
e.currentTarget.style.display = 'none';
81+
}}
82+
alt={integration.identifier}
83+
width={42}
84+
height={42}
85+
/>
8986
{integration.identifier === 'youtube' ? (
9087
<img
9188
src="/icons/platforms/youtube.svg"

0 commit comments

Comments
 (0)