Skip to content

Commit 7bf44db

Browse files
Merge branch 'dev' into ft/show-submission-form-for-multiple-submissions
2 parents b7b0c4d + 82a956b commit 7bf44db

File tree

24 files changed

+146
-57
lines changed

24 files changed

+146
-57
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Describe the bug\*\*
2+
3+
A clear and concise description of what the bug is.
4+
5+
**To Reproduce**
6+
Steps to reproduce the behavior:
7+
8+
1. Go to '...'
9+
2. Click on '....'
10+
3. Scroll down to '....'
11+
4. See error
12+
13+
**Expected behavior**
14+
A clear and concise description of what you expected to happen.
15+
16+
**Screenshots**
17+
If applicable, add screenshots to help explain your problem.
18+
19+
**Environment:**
20+
21+
- Operating System: [e.g. iOS]
22+
- Browser and version: (To be filled based on the specific browser used)
23+
- Application or software version: (The specific version of the application where the issue is discovered)
24+
25+
**Additional context**
26+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
5+
6+
---
7+
8+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
**Is your feature request related to a problem? Please describe.**
2+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
3+
4+
**Describe the solution you'd like**
5+
A clear and concise description of what you want to happen.
6+
7+
**Describe alternatives you've considered**
8+
A clear and concise description of any alternative solutions or features you've considered.
9+
10+
**Additional context**
11+
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Submit a pull request
2+
3+
- [ ] This is not a duplicate of an existing pull request.
4+
- [ ] No existing features have been broken without good reason.
5+
- [ ] Your commit messages are detailed
6+
- [ ] The code style guideline have been followed.
7+
- [ ] Documentation has been updated to reflect your changes.
8+
- [ ] Tests have been added or updated to reflect your changes.
9+
- [ ] All tests pass.
10+
11+
---
12+
13+
Replace any ":question:" below with information about your pull request.
14+
15+
## Pull Request Details
16+
17+
Provide details about your pull request and what it adds, fixes, or changes.
18+
19+
:question:
20+
21+
## Breaking Changes
22+
23+
Describe what features are broken by this pull request and why, if any.
24+
25+
:question:
26+
27+
## Issues Fixed
28+
29+
Enter the issue numbers resolved by this pull request below, if any.
30+
31+
1. :question:
32+
33+
## Other Relevant Information
34+
35+
Provide any other important details below.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ NEXT_PUBLIC_FIREBASE_PROJECT_ID = "dacade-d02d2";
8282
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID = "${config.measurementId}";
8383
NEXT_PUBLIC_FIREBASE_APP_ID = "1:194074425069:web:e519dce8d78a458d8b3ee4";
8484

85-
NEXT_PUBLIC_API_BASE_URL = "https://europe-west1-dacade-d02d2.cloudfunctions.net/api";
85+
NEXT_PUBLIC_API_BASE_URL = "https://us-central1-dacade-d02d2.cloudfunctions.net/api";
8686

8787
NEXT_PUBLIC_BUGSNAG_API_KEY = "";
8888
NEXT_PUBLIC_SHOW_LANGUAGE_SELECTOR = true;
8989

9090
NEXT_PUBLIC_DISCORD_CLIENT_ID = "";
91-
NEXT_PUBLIC_DISCORD_CALLBACK_URL = "https://europe-west1-dacade-d02d2.cloudfunctions.net/api/discord-bot/oauth/callback";
91+
NEXT_PUBLIC_DISCORD_CALLBACK_URL = "https://us-central1-dacade-d02d2.cloudfunctions.net/api/discord-bot/oauth/callback";
9292
NEXT_PUBLIC_DISCORD_OAUTH_BASE_URL = "https://discord.com/api/oauth2/authorize";
9393
NEXT_PUBLIC_DISCORD_SCOPE = "identify email";
9494

src/components/cards/Bounty.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default function BountyCard({ bounty }: BountyProps): ReactElement {
5757
const Component = link.startsWith("http") ? "a" : Link;
5858

5959
return (
60-
<div className="cursor-pointer 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">
60+
<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">
6161
<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">
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>
@@ -71,15 +71,16 @@ export default function BountyCard({ bounty }: BountyProps): ReactElement {
7171
{bounty.submissions?.length ? (
7272
<div className="mt-4 space-y-0 divide-y divide-gray-200 border-t border-t-solid border-gray-200">
7373
{bounty.submissions.map((submission) => (
74-
<Link
75-
href={navigation.community.submissionPath(submission.id, bounty.challenge, bounty?.slug)}
76-
className="flex space-x-1 relative text-sm font-medium py-3"
77-
key={submission.id}
78-
>
74+
<div className="flex space-x-1 relative text-sm font-medium py-3" key={submission.id}>
7975
<div className="flex justify-between w-full pr-0 gap-1 sm:gap-0">
8076
<div className="flex space-x-1">
8177
<Avatar user={submission.user} size="mini" />
82-
<div className="text-ellipsis overflow-hidden w-17 sm:w-auto whitespace-nowrap">{submission.user.displayName}</div>
78+
<Link
79+
className="text-ellipsis overflow-hidden w-17 sm:w-auto whitespace-nowrap"
80+
href={navigation.community.submissionPath(submission.id, bounty.challenge, bounty?.slug)}
81+
>
82+
{submission.user.displayName}
83+
</Link>
8384
<div className="flex align-middle text-gray-500 text-middle bg-gray-200 px-2 text-xxs rounded-xl m-0 h-5">
8485
{submission.metadata && submission.metadata.feedbacks ? submission.metadata.feedbacks : 0}
8586
</div>
@@ -94,7 +95,7 @@ export default function BountyCard({ bounty }: BountyProps): ReactElement {
9495
)}
9596
</div>
9697
</div>
97-
</Link>
98+
</div>
9899
))}
99100
</div>
100101
) : (

src/components/cards/Reputation.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import Link from "next/link";
21
import Avatar from "@/components/ui/Avatar";
32
import Currency from "@/components/ui/Currency";
43
import { Community } from "@/types/community";
54
import { ReactElement } from "react";
65
import { User } from "@/types/bounty";
6+
import Link from "next/link";
77

88
/**
99
* Interface for the reputation card props
@@ -32,16 +32,16 @@ interface ReputationCardProps {
3232
*/
3333
export default function ReputationCard({ details = {} }: ReputationCardProps): ReactElement {
3434
return (
35-
<Link href={details?.community ? `/communities/${details.community.slug}` : ""} className="flex space-x-3 text-left hover:bg-gray-50 pb-3 -mx-5 px-5">
35+
<div className="flex space-x-3 text-left hover:bg-gray-50 pb-3 -mx-5 px-5">
3636
<Avatar icon={details.community?.icon} color={details.community?.colors?.cover?.background || details.community?.colors.primary} size="medium" shape="rounded" />
3737
{details?.score && (
38-
<div className="pt-1">
38+
<Link href={details?.community ? `/communities/${details.community.slug}` : ""} className="pt-1">
3939
<span className="block text-base font-medium leading-normal">
4040
<Currency value={details.score} token="REP" />
4141
</span>
4242
<span className="block font-normal text-sm">{details.community?.name}</span>
43-
</div>
43+
</Link>
4444
)}
45-
</Link>
45+
</div>
4646
);
4747
}

src/components/cards/challenge/Challenge.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Link from "next/link";
77
import RelatedContent from "./RelatedContent";
88
import Badges from "./Badges";
99
import { useMemo } from "react";
10-
import { useTranslation } from "react-i18next";
10+
import { useTranslation } from "next-i18next";
1111

1212
/**
1313
* `ChallengeCard` is a function component that renders a card
@@ -25,10 +25,12 @@ interface ChallengeCardProps {
2525
}
2626
export default function ChallengeCard({ data, community, isCourseEnd }: ChallengeCardProps) {
2727
const { t } = useTranslation();
28+
2829
const link = `/communities/${community.slug}/challenges/${data.id}`;
2930
const expiresAt = useMemo(() => (data.expiresAt ? new Date(data.expiresAt).toLocaleDateString() : null), [data.expiresAt]);
3031
const reward = isCourseEnd ? data?.rewards?.find((reward) => reward.type === "SUBMISSION") : data?.reward;
3132
const totalReward = data?.rewards?.reduce((acc, reward) => (acc += Number(reward.amount)), 0);
33+
3234
return (
3335
<div className="border-solid border border-gray-200 bg-gray-50 rounded-3xl mb-5 group text-gray-700">
3436
<div className="border-solid border-b border-gray-300 bg-white rounded-3xl sm:p-8 sm:pb-6 w-full p-6">
@@ -46,7 +48,7 @@ export default function ChallengeCard({ data, community, isCourseEnd }: Challeng
4648
<div className="md:pl-2 max-w-max">
4749
<div className="flex text-sm text-gray-700">
4850
<span className="block font-medium pr-1">
49-
{community.slug === "celo" && "NFT"} {t("communities.overview.challenge.certificate")}
51+
{community?.slug === "celo" && "NFT"} {t("communities.overview.challenge.certificate")}
5052
</span>
5153
</div>
5254
<div className="text-gray-400 text-xs font-normal">Upon successful completion</div>

src/components/cards/challenge/Overview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import Coin from "@/components/ui/Coin";
32
import { Challenge, Reward } from "@/types/course";
43
import { useTranslation } from "next-i18next";
@@ -43,7 +42,7 @@ export default function Overview({ challenge, community }: Props) {
4342
<div className="md:pl-2 max-w-max">
4443
<div className="flex text-sm text-gray-700">
4544
<span className="block font-medium pr-1">
46-
{community.slug === "celo" && "NFT"} {t("communities.overview.challenge.certificate")}
45+
{community?.slug === "celo" && "NFT"} {t("communities.overview.challenge.certificate")}
4746
</span>
4847
</div>
4948
<div className="text-gray-400 text-xs font-medium">{t("communities.overview.challenge.subtitle")}</div>

src/components/layout/NotificationBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function Notification(): ReactElement {
3333
<div className="w-full flex justify-center">
3434
{error && (
3535
<div className="bg-red-50 border border-red-100 text-red-900 px-4 py-3 rounded-md relative w-full max-w-md justify-center flex" role="alert">
36-
<span className="block sm:inline">{t(error?.error?.data.message || error?.code)}</span>
36+
<span className="block sm:inline">{t(error?.error?.data?.message || error?.code)}</span>
3737
</div>
3838
)}
3939
</div>

0 commit comments

Comments
 (0)