Skip to content

Commit b208ad2

Browse files
authored
Merge pull request #1082 from dacadeorg/fix/bounty-card-overflow
Fix/bounty card overflow
2 parents 0e6fbdd + 5c6af12 commit b208ad2

File tree

1 file changed

+36
-9
lines changed

1 file changed

+36
-9
lines changed

src/components/cards/Bounty.tsx

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,49 @@ export default function BountyCard({ bounty }: BountyProps): ReactElement {
5252
if (bounty.submissions?.link) return `/${bounty.submissions?.link}`;
5353
if (isChallenge) return navigation.community.challengePath(bounty.challenge, bounty?.slug);
5454
return navigation.community.submissionsPath(bounty.challenge, bounty?.slug);
55-
}, [bounty.challenge, bounty.course?.slug, bounty.slug, bounty.submissions?.link, bounty.url, isChallenge, navigation.community]);
55+
}, [bounty.challenge, bounty.slug, bounty.submissions?.link, bounty.url, isChallenge, navigation.community]);
5656

5757
const Component = link.startsWith("http") ? "a" : Link;
5858

5959
return (
6060
<div className="p-5 flex md:flex-row-reverse md:space-x-5 px-5 min-h-32 md:h-auto md:w-full justify-between hover:bg-secondary relative">
61-
<div className="bg-theme-accent flex-col w-full h-full justify-between md:-space-y-1 pl-3 pr-5 mt-7 mb-5">
61+
<div className="bg-theme-accent flex-col w-full h-full justify-between md:-space-y-1 pl-3 pr-5 my-5">
6262
<Component className="relative w-full block" href={link}>
6363
<div className="font-medium text-md md:pt-1.5">{bounty.course ? bounty.course.name : bounty.name}</div>
6464
</Component>
65-
<Component className="inline-flex md:flex h-2/3 md:flex-row flex-col-reverse justify-between" href={link}>
66-
<div className="text-sm pt-8 md:pt-2 md:pb-4 text-gray-600">{type()}</div>
67-
<div>
68-
<Reward type="gray" reward={bounty.reward}></Reward>
69-
</div>
70-
</Component>
65+
<div className="flex justify-between w-full md:block">
66+
<Component className="inline-flex md:flex md:flex-row flex-col-reverse justify-between" href={link}>
67+
<div className="text-sm pt-8 md:pt-2 md:pb-4 text-gray-600">{type()}</div>
68+
<div className="flex">
69+
<Reward type="gray" reward={bounty.reward}></Reward>
70+
</div>
71+
</Component>
72+
<Component className="self-end relative md:hidden" href={link}>
73+
<Avatar
74+
icon={bounty.icon}
75+
image={bounty.image}
76+
color={bounty.colors?.cover?.background || bounty.colors?.primary}
77+
size="medium-fixed"
78+
shape="rounded"
79+
className="w-15 h-15 rounded-xl overflow-hidden"
80+
user={null}
81+
useLink={false}
82+
/>
83+
{bounty?.submissions && (
84+
<Badge
85+
customStyle={{
86+
bottom: "-4px",
87+
right: "-4px",
88+
fontSize: 14,
89+
backgroundColor: bounty.colors.accent,
90+
}}
91+
size="medium"
92+
value={bounty?.unreviewedSubmissionsCount}
93+
className="bottom-0 -right-1 absolute p-4"
94+
/>
95+
)}
96+
</Component>
97+
</div>
7198
{bounty.submissions?.length ? (
7299
<div className="mt-4 space-y-0 divide-y divide-gray-200 border-t border-t-solid border-gray-200">
73100
{bounty.submissions.map((submission) => (
@@ -102,7 +129,7 @@ export default function BountyCard({ bounty }: BountyProps): ReactElement {
102129
<></>
103130
)}
104131
</div>
105-
<Component className="self-start relative mt-15 md:mt-7" href={link}>
132+
<Component className="self-start relative mt-7 hidden md:block" href={link}>
106133
<Avatar
107134
icon={bounty.icon}
108135
image={bounty.image}

0 commit comments

Comments
 (0)