Skip to content

Commit f7dd7e0

Browse files
committed
feat: merge branch dev into ft/incorporate-new-certificate
2 parents cfc476c + fca216f commit f7dd7e0

File tree

30 files changed

+247
-101
lines changed

30 files changed

+247
-101
lines changed

next-i18next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require("path");
33

44
module.exports = {
55
i18n: {
6-
locales: ["en", "bg", "es", "hr"],
6+
locales: ["en", "bg", "es", "hr", "ko", "zh"],
77
defaultLocale: "en",
88
},
99
localePath: path.resolve("./public/locales"),

src/components/badges/RewardBadge.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Coin from "@/components/ui/Coin";
2+
import { shortenNumber } from "@/utilities";
23
import classNames from "classnames";
34
import { ReactElement } from "react";
45

@@ -46,8 +47,7 @@ export default function RewardBadge({ reward = {}, type = "transparent", display
4647
{token && <Coin token={token} size="small" />}
4748
{amount && (
4849
<div className="font-medium pl-0 pr-2">
49-
{displayAmount && amount}
50-
{token}
50+
{displayAmount && shortenNumber(amount)} {token}
5151
</div>
5252
)}
5353
</span>

src/components/cards/Reputation.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,16 @@ interface ReputationCardProps {
3232
*/
3333
export default function ReputationCard({ details = {} }: ReputationCardProps): ReactElement {
3434
return (
35-
<div className="flex space-x-3 text-left hover:bg-gray-50 pb-3 -mx-5 px-5">
36-
<Avatar icon={details.community?.icon} color={details.community?.colors?.cover?.background || details.community?.colors.primary} size="medium" shape="rounded" />
35+
<div className="flex space-x-3 text-left hover:bg-gray-50 py-3 -mx-5 px-5 relative">
36+
<Avatar
37+
icon={details.community?.icon}
38+
color={details.community?.colors?.cover?.background || details.community?.colors.primary}
39+
size="medium"
40+
shape="rounded"
41+
useLink={false}
42+
/>
3743
{details?.score && (
38-
<Link href={details?.community ? `/communities/${details.community.slug}` : ""} className="pt-1">
44+
<Link href={details?.community ? `/communities/${details.community.slug}` : ""} className="pt-1 before:content-[''] before:absolute before:top-0 before:left-0 before:w-full before:h-full before:z-0 before:block">
3945
<span className="block text-base font-medium leading-normal">
4046
<Currency value={details.score} token="REP" />
4147
</span>

src/components/cards/challenge/Challenge.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Badges from "./Badges";
77
import { useMemo } from "react";
88
import { useTranslation } from "next-i18next";
99
import Image from "next/image";
10+
import { shortenNumber } from "@/utilities";
1011

1112
/**
1213
* `ChallengeCard` is a function component that renders a card
@@ -27,8 +28,7 @@ export default function ChallengeCard({ data, community, isCourseEnd }: Challeng
2728
const link = `/communities/${community.slug}/challenges/${data.id}`;
2829
const expiresAt = useMemo(() => (data.expiresAt ? new Date(data.expiresAt).toLocaleDateString() : null), [data.expiresAt]);
2930
const reward = isCourseEnd ? data?.rewards?.find((reward) => reward.type === "SUBMISSION") : data?.reward;
30-
const learningModulesCount = useMemo(() => (data?.learningModules?.length ? data?.learningModules.length : 0), [data?.learningModules?.length]);
31-
31+
const learningModulesCount = data?.learningModules.length || 0;
3232

3333
return (
3434
<div className="w-full justify-between- flex flex-col sm:flex-row md:flex-col lg:flex-row border-solid border border-gray-200 bg-gray-50 rounded-3xl mb-5 group text-gray-700">
@@ -72,7 +72,7 @@ export default function ChallengeCard({ data, community, isCourseEnd }: Challeng
7272
<Coin size="small" token={reward?.token} />
7373
<div className="text-sm">
7474
<span>
75-
{reward.amount} {reward.token}
75+
{shortenNumber(reward.amount)} {reward.token}
7676
</span>
7777
<span>
7878
{reward.type === "SUBMISSION" ? (

src/components/cards/challenge/Overview.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useTranslation } from "next-i18next";
44
import DateManager from "@/utilities/DateManager";
55
import Certificate from "@/components/ui/Certificate";
66
import { Community } from "@/types/community";
7+
import { shortenNumber } from "@/utilities";
78

89
interface Props {
910
challenge: Challenge;
@@ -53,15 +54,15 @@ export default function Overview({ challenge, community }: Props) {
5354
<Coin size="medium" token={reward?.token} />
5455
<div className="text-sm md:pl-2 max-w-max">
5556
<div className="flex gap-1 text-gray-700 font-medium">
56-
<span>{reward.amount}</span>
57+
<span>{shortenNumber(reward.amount)}</span>
5758
<span>{reward?.token}</span>
5859
<span>{t("communities.overview.challenge.rewards")}</span>
5960
</div>
6061
<div className="text-gray-400 text-xs font-medium leading-3 mt-1 flex">
6162
{challenge.rewards.map((reward, index) => (
6263
<span key={`reward-${index}`}>
6364
{index > 0 && "\u003B "}
64-
{reward.amount} {reward.token}/{formatToken(reward.type)}
65+
{shortenNumber(reward.amount)} {reward.token}/{formatToken(reward.type)}
6566
</span>
6667
))}
6768
</div>

src/components/cards/community/List.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function CommunityListCard({ community }: CommunityListCardProps)
5959
{t("communities.list-card.earn")} <span className="font-bold">{reward?.token}</span>
6060
</div>
6161
<div className="font-light leading-tight">
62-
{t(community.courses !== 1 ? "communities.card.courses" : "communities.card.course", { count: community.courses })}
62+
{t(community.challenges > 1 ? "communities.card.challenges" : "communities.card.challenge", { count: community.challenges })}
6363
</div>
6464
</div>
6565
</div>

src/components/cards/community/_partials/RewardBadge.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { CSSProperties, ReactElement } from "react";
22
import Coin from "@/components/ui/Coin";
33
import classNames from "classnames";
4+
import { shortenNumber } from "@/utilities";
45

56
/**
67
* Interface for Badge props
@@ -40,8 +41,7 @@ export default function RewardBadge({ reward = {}, type = "transparent", styles
4041
{reward.token && <Coin token={reward.token} size="small" />}
4142

4243
<div className="pl-0 pr-2 font-medium">
43-
{reward.amount}
44-
{reward.token}
44+
{shortenNumber(reward.amount as number)} {reward.token}
4545
</div>
4646
</span>
4747
);

src/components/cards/community/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default function CommunityCard({ showRewards = true, community }: Communi
7474
</div>
7575
<div className="flex flex-col items-start justify-start max-w-xs -mt-4 md:flex-row lg:flex-col md:-mt-7 md:max-w-lg">
7676
{showRewards && reward && (
77-
<div className="text-sm flex">
77+
<div className="text-sm flex bg-lime-400">
7878
<RewardBadge reward={{ token: reward.token }} styles={rewardBadgeStyle} />
7979
</div>
8080
)}

src/components/popups/user/Dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ const UserProfileDropdown = ({ buttonStyles, onClose }: { buttonStyles?: CSSProp
128128
) : (
129129
<></>
130130
)}
131-
{showLanguageSwitcher && <LanguageList />}
131+
{showLanguageSwitcher && <LanguageList onSelect={onClose} />}
132132
<div className="p-4 flex justify-center bg-indigo-50">
133133
<div className="z-10">
134134
<Button

src/components/sections/bounties/Navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function BountiesNavigation(): ReactElement {
5555
...UniqBy(
5656
bounties.map((bounty) => {
5757
return {
58-
label: bounty.name,
58+
label: bounty.community,
5959
exact: true,
6060
link: `/bounties/${bounty.slug}`,
6161
};

0 commit comments

Comments
 (0)