Skip to content

Commit 161357c

Browse files
committed
Merge branch 'stage'
2 parents 056a4c1 + ce2052c commit 161357c

File tree

8 files changed

+26
-39
lines changed

8 files changed

+26
-39
lines changed

src/components/cards/profile/Referral.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Referral as ReferralType } from "@/types/community";
77
import Link from "next/link";
88
import TimeIcon from "@/icons/time.svg";
99
import RewardBadge from "@/components/badges/RewardBadge";
10-
import { Evaluation, Submission } from "@/types/bounty";
10+
import { Evaluation } from "@/types/bounty";
1111

1212
interface ReferralProps {
1313
referral: ReferralType;
@@ -29,7 +29,6 @@ export default function Referral({ referral }: ReferralProps): ReactElement {
2929
const { locale } = useRouter();
3030
const joinedAt = useMemo(() => DateManager.fromNow(referral.created_at, locale), [locale, referral.created_at]);
3131
const rewardAt = useMemo(() => (referral.rewarded ? DateManager.fromNow(referral.updated_at, locale) : null), [locale, referral.rewarded, referral.updated_at]);
32-
const challengeLink = (submission: Submission) => `/communities/${submission.community.slug}/challenges/${submission.challenge.id}/submissions/${submission.id}`
3332
const status = (evaluation: Evaluation) => {
3433
if (!evaluation) return t("referrals.challenge.evaluation.status.pending")
3534
return t(evaluation?.reward ? "referrals.challenge.evaluation.status.passed" : "referrals.challenge.evaluation.status.failed")
@@ -51,11 +50,11 @@ export default function Referral({ referral }: ReferralProps): ReactElement {
5150
<div className="flex-grow md:ml-19">
5251
<div className="pt-1">
5352
<ul className="pb-1 font-light leading-loose text-gray-700 grid divide-y-2 space-y-4 divide-gray-200">
54-
{referral?.submissions?.length ? referral.submissions.map((submission) => (
53+
{referral.user.submissions.length ? referral.user.submissions.map((submission) => (
5554
<li key={submission.id} className="grid md:flex justify-between pt-4 gap-2 md:gap-0">
5655
<span className="grid gap-2">
5756
<span>
58-
{status(submission.metadata.evaluation)} <Link href={challengeLink(submission)} className="font-bold underline text-base- underline-offset-2">{submission.challenge.name} {t("referrals.submission.challenge")}</Link>
57+
{status(submission.metadata.evaluation)} <Link href={submission.link} className="font-bold underline text-base- underline-offset-2">{submission.challengeData.name} {t("referrals.submission.challenge")}</Link>
5958
</span>
6059
{!submission?.metadata?.evaluation && <span className="mr-0 flex items-center gap-2.5 leading-none "> <TimeIcon />{t("referrals.challenge.evaluation.pending")}</span>}
6160
</span>

src/components/sections/challenges/Submission.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { useMultiSelector } from "@/hooks/useTypedSelector";
99
import { useDispatch } from "@/hooks/useTypedDispatch";
1010
import { createSubmission, createSubmissionTeam } from "@/store/feature/communities/challenges/submissions";
1111
import { useForm } from "react-hook-form";
12-
import classNames from "classnames";
1312
import { useTranslation } from "next-i18next";
1413
import { ReactElement } from "react";
1514
import { Submission as TSubmission, User } from "@/types/bounty";
@@ -163,11 +162,7 @@ export default function Submission(): ReactElement {
163162
/>
164163
</div>
165164
{challenge.format.githubLink && (
166-
<div
167-
className={classNames("w-full border border-solid border-gray-200 m-0 rounded-b text-lg py-0 leading-none items-center space-x-2", {
168-
"border-t-0": challenge.format.text,
169-
})}
170-
>
165+
<div className="w-full m-0 text-lg py-0 leading-none items-center space-x-2">
171166
<div>
172167
<GithubLinkInput
173168
id="input-github"

src/components/sections/homepage/_partials/testimonials/CommunityStats.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export default function CommunityStats() {
3737
return (
3838
<div className="p-7 bg-primary rounded-3.5xl mx-auto text-white relative md:absolute md:top-28 lg:top-32 xl:w-1/3 md:w-4/6 z-10 sm:max-w-sm">
3939
<h3 className="m-0 text-4.5xl w-3/4">{t("testimonials.community.title")}</h3>
40-
<div className="relative mt-11 mb-5 divide-y divide-white divide-dotted">
40+
<div className="relative divide-y divide-white divide-dotted">
4141
{stats.map((stat) => (
42-
<div key={stat.title} className="py-5">
43-
<span className="block text-2xl mb-2">{stat.count}</span>
42+
<div key={stat.title} className="py-6">
43+
<span className="block text-.5xl mb-2">{stat.count}</span>
4444
<p className="text-base w-3/4 m-0">
4545
<span className="font-graphik font-medium">{t(stat.title)}</span> {t(stat.description)}
4646
</p>

src/components/ui/GithubLinkInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default forwardRef<HTMLInputElement, GithubLinkInputProps>(function Githu
8383
);
8484

8585
return (
86-
<div className="flex items-center w-full border border-t-0 border-gray-200">
86+
<div className="flex items-center w-full border border-t-0 rounded-b border-gray-200">
8787
<div className="flex-none pl-3.75">
8888
<GithubIcon className="relative flex-none text-gray-400 m-0 p-0 block -mt-0.5" />
8989
</div>

src/components/ui/Hint.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type HintProps = {
66
};
77

88
function Hint({ children, className }: HintProps): ReactElement {
9-
return <div className={`bg-yellow-50 text-yellow-900 py-5 px-8 border border-solid border-yellow-100 text-base hint-container ${className}`}>{children}</div>;
9+
return <div className={`bg-blue-50 text-primary p-3 border border-blue-200 rounded text-base hint-container ${className}`}>{children}</div>;
1010
}
1111

1212
export default Hint;

src/pages/communities/[slug]/challenges/[challenge_id]/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ export default function ChallengePage() {
144144
<div className="grid mt-8 space-y-8">
145145
<Hint>
146146
<p
147-
className="text-lg py-4"
148147
dangerouslySetInnerHTML={{
149148
__html: t(
150149
challenge?.multipleSubmissions ? "communities.challenge.submission.multiple-submissions" : "communities.challenge.submission.no-multiple-submissions"
@@ -170,11 +169,13 @@ export default function ChallengePage() {
170169
</div>
171170
) : (
172171
<div>
173-
<Hint className="mt-6 flex flex-col md:flex-row">
174-
<p>To be able to submit</p>&nbsp;
175-
<Link className="underline" href="/login">
176-
Login.
177-
</Link>
172+
<Hint className="mt-6">
173+
<p>
174+
To be able to submit
175+
<Link className="underline pl-1" href="/login">
176+
Login.
177+
</Link>
178+
</p>
178179
</Hint>
179180
</div>
180181
)}

src/styles/globals.css

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,24 +98,12 @@ body {
9898
}
9999

100100
.message-bubble {
101-
@apply w-72 p-8 rounded-3.5xl relative text-base;
101+
@apply w-72 p-6 rounded-3.5xl rounded-bl-none relative text-base border border-black border-opacity-5;
102102

103103
background: #fefce8;
104104
color: #713f12;
105105
}
106106

107-
.message-bubble::before {
108-
width: 0;
109-
height: 0;
110-
left: -28px;
111-
content: "";
112-
position: absolute;
113-
border-left: 28px solid transparent;
114-
bottom: 0;
115-
border-right: 28px solid transparent;
116-
border-bottom: 28px solid #fefce8;
117-
}
118-
119107
@media only screen and (min-width: 992px) {
120108
.quadratic-card {
121109
@apply p-8 mb-5;
@@ -349,7 +337,7 @@ div {
349337
}
350338

351339
.hint-container a {
352-
font-weight: 400;
340+
font-weight: 500;
353341
text-decoration: underline;
354342
}
355343

src/types/community.d.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ export interface Colors {
4242
background: string;
4343
};
4444
}
45+
interface ReferralSubmission extends Submission {
46+
challengeData: Challenge,
47+
link: string
48+
}
49+
interface UserReferral extends User {
50+
submissions: ReferralSubmission[]
51+
}
4552
export interface Referral {
46-
user: User;
4753
id: string;
4854
name: string;
4955
ref: string;
@@ -53,13 +59,11 @@ export interface Referral {
5359
community: Community;
5460
timestamp: number;
5561
reward: Reward;
56-
user: User;
5762
challenge: Challenge;
58-
community: Community;
5963
submissions: Submission[];
6064
rewarded: boolean;
6165
metadata?: {
6266
reward: Reward;
6367
};
64-
user: User;
68+
user: UserReferral;
6569
}

0 commit comments

Comments
 (0)