Skip to content

Commit 4b06856

Browse files
committed
Merge branch 'stage'
2 parents f110aa9 + 3477ac8 commit 4b06856

File tree

16 files changed

+87
-35
lines changed

16 files changed

+87
-35
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"),

public/locales/bg/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@
359359
"kyc.default.title": "Identity verification",
360360
"kyc.default.completed": "Your identity has been verified successfully.",
361361
"kyc.default.reason": "To ensure the safety and security of our platform, we require all users to verify their identity. This verification process helps us maintain a trusted community of members who are committed to upholding our standards. Please take a moment to complete your KYC verification to help us in our efforts to create a safe and secure environment for everyone.",
362+
"kyc.verification.pending": "Вашата верификация в момента се обработва. Благодарим ви за търпението.",
363+
"kyc.verification.rejected": "Съжаляваме да ви информираме, че процесът на вашата верификация е отхвърлен. Моля, свържете се с екипа за поддръжка за повече информация.",
362364
"kyc.default.button": "Start verification",
363365
"kyc.default.button.completed": "Go to profile",
364366
"kyc.payout.reason": "To cashout, you need to verify your identity first.",

public/locales/en/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@
417417
"kyc.default.title": "Identity verification",
418418
"kyc.default.completed": "Your identity has been verified successfully.",
419419
"kyc.default.reason": "To ensure the safety and security of our platform, we require all users to verify their identity. This verification process helps us maintain a trusted community of members who are committed to upholding our standards. Please take a moment to complete your KYC verification to help us in our efforts to create a safe and secure environment for everyone.",
420+
"kyc.verification.pending":"Your verification is currently being processed. Thank you for your patience",
421+
"kyc.verification.rejected":"We regret to inform you that your verification process has been rejected. Please contact support team for more information.",
420422
"kyc.default.button": "Start verification",
421423
"kyc.default.button.completed": "Go to profile",
422424
"kyc.payout.reason": "To cashout, you need to verify your identity first.",

public/locales/es/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,8 @@
373373
"kyc.default.title": "Identity verification",
374374
"kyc.default.completed": "Your identity has been verified successfully.",
375375
"kyc.default.reason": "To ensure the safety and security of our platform, we require all users to verify their identity. This verification process helps us maintain a trusted community of members who are committed to upholding our standards. Please take a moment to complete your KYC verification to help us in our efforts to create a safe and secure environment for everyone.",
376+
"kyc.verification.pending": "Su verificación está siendo procesada actualmente. Gracias por su paciencia.",
377+
"kyc.verification.rejected": "Lamentamos informarle que su proceso de verificación ha sido rechazado. Por favor, póngase en contacto con el equipo de soporte para obtener más información.",
376378
"kyc.default.button": "Start verification",
377379
"kyc.default.button.completed": "Go to profile",
378380
"kyc.payout.reason": "To cashout, you need to verify your identity first.",

public/locales/hr/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@
359359
"kyc.default.title": "Identity verification",
360360
"kyc.default.completed": "Your identity has been verified successfully.",
361361
"kyc.default.reason": "To ensure the safety and security of our platform, we require all users to verify their identity. This verification process helps us maintain a trusted community of members who are committed to upholding our standards. Please take a moment to complete your KYC verification to help us in our efforts to create a safe and secure environment for everyone.",
362+
"kyc.verification.pending": "Vaša verifikacija trenutno se obrađuje. Hvala vam na strpljenju.",
363+
"kyc.verification.rejected": "Žao nam je obavijestiti vas da je vaš proces verifikacije odbijen. Molimo vas da kontaktirate tim za podršku radi više informacija.",
362364
"kyc.default.button": "Start verification",
363365
"kyc.default.button.completed": "Go to profile",
364366
"kyc.payout.reason": "To cashout, you need to verify your identity first.",

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}

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/popups/KYCVerification.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import Modal from "@/components/ui/Modal";
22
import { useTranslation } from "next-i18next";
33
import ArrowButton from "@/components/ui/button/Arrow";
44
import { useSelector } from "@/hooks/useTypedSelector";
5-
import { closeVerificationModal, launchWebSdk, triggerCompleteAction } from "@/store/feature/kyc.slice";
5+
import { KYCSTATUS, closeVerificationModal, launchWebSdk, triggerCompleteAction } from "@/store/feature/kyc.slice";
66
import { useDispatch } from "@/hooks/useTypedDispatch";
7+
import { useMemo } from "react";
8+
import { toggleBodyScrolling } from "@/store/feature/ui.slice";
79

810
/**
911
* KYCVerification Props Interface
@@ -32,9 +34,13 @@ export default function KYCVerification({ onCompleted }: KYCVerificationProps) {
3234

3335
const verificationData = useSelector((state) => state.sumsubVerification);
3436

35-
const { showModal, completed, completedText, description, verifying, completedActionText, actionText, loading, title } = verificationData;
37+
const { showModal, completed, verifying, completedActionText, actionText, loading, title } = verificationData;
38+
const user = useSelector((state) => state.user.data);
39+
40+
const kycStatus = user?.kycStatus;
3641

3742
const closeModal = () => {
43+
dispatch(toggleBodyScrolling(false));
3844
dispatch(closeVerificationModal());
3945
};
4046
const verify = () => {
@@ -48,13 +54,20 @@ export default function KYCVerification({ onCompleted }: KYCVerificationProps) {
4854
triggerCompleteAction();
4955
};
5056

57+
const statusMessage = useMemo(() => {
58+
if (kycStatus === KYCSTATUS.VERIFIED) return t("kyc.default.completed");
59+
if (kycStatus === KYCSTATUS.PENDING) return t("kyc.verification.pending");
60+
if (kycStatus === KYCSTATUS.REJECTED) return t("kyc.verification.rejected");
61+
return t("kyc.default.reason");
62+
}, [kycStatus, t]);
63+
5164
return (
5265
<Modal show={showModal} onClose={closeModal}>
5366
<div className="px-6 py-6">
5467
{!verifying ? (
5568
<div className="flex flex-col text-left">
5669
<h1 className="text-.5xl leading-snug font-medium">{title || t("kyc.default.title")}</h1>
57-
<p className="pt-8">{completed ? completedText || t("kyc.default.completed") : description || t("kyc.default.reason")}</p>
70+
<p className="pt-8">{statusMessage}</p>
5871
</div>
5972
) : (
6073
<></>
@@ -65,7 +78,7 @@ export default function KYCVerification({ onCompleted }: KYCVerificationProps) {
6578
<span className="text-sm font-medium cursor-pointer text-primary" onClick={closeModal}>
6679
{t("profile.edit.close")}
6780
</span>
68-
{!verifying && (
81+
{!verifying && kycStatus !== KYCSTATUS.REJECTED && (
6982
<ArrowButton loading={loading} disabled={loading} onClick={verify}>
7083
{completed ? completedActionText || t("kyc.default.button.completed") : actionText || t("kyc.default.button")}
7184
</ArrowButton>

src/components/popups/user/Dropdown.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { useDispatch } from "@/hooks/useTypedDispatch";
1616
import VerifiedIcon from "@/icons/verified.svg";
1717
import { IRootState } from "@/store";
1818
import { Wallet } from "@/types/wallet";
19+
import { KYCSTATUS } from "@/store/feature/kyc.slice";
1920

2021
/**
2122
* interface for UserProfileDropdown multiSelector
@@ -55,7 +56,7 @@ const UserProfileDropdown = ({ buttonStyles, onClose }: { buttonStyles?: CSSProp
5556
error: (state: IRootState) => state.store.error,
5657
});
5758
const username = user?.displayName;
58-
const isKycVerified = useMemo(() => user?.kycStatus === "VERIFIED", [user]);
59+
const isKycVerified = useMemo(() => user?.kycStatus === KYCSTATUS.VERIFIED, [user]);
5960

6061
/**
6162
* Logout handler.

src/components/sections/profile/Header.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import { useRouter } from "next/router";
1010
import { useMemo } from "react";
1111
import { useTranslation } from "next-i18next";
1212
import { useDispatch } from "@/hooks/useTypedDispatch";
13-
import { openVerificationModal } from "@/store/feature/kyc.slice";
13+
import { KYCSTATUS, openVerificationModal } from "@/store/feature/kyc.slice";
1414
import KYCVerification from "@/components/popups/KYCVerification";
1515
import { useDiscordConnect } from "@/hooks/useDiscordConnect";
1616
import { User } from "@/types/bounty";
1717
import { IRootState } from "@/store";
1818
import Link from "next/link";
19+
import { toggleBodyScrolling } from "@/store/feature/ui.slice";
1920

2021
/**
2122
* interface for ProfileHeader multiSelector
@@ -41,7 +42,7 @@ export default function ProfileHeader() {
4142
const { authUser, profileUser, isKycVerified } = useMultiSelector<unknown, ProfileHeaderMultiSelector>({
4243
authUser: (state: IRootState) => state.user.data,
4344
profileUser: (state: IRootState) => state.profileUser.current,
44-
isKycVerified: (state: IRootState) => state.user.data?.kycStatus === "VERIFIED",
45+
isKycVerified: (state: IRootState) => state.user.data?.kycStatus === KYCSTATUS.VERIFIED,
4546
});
4647

4748
const user = useMemo(() => {
@@ -64,8 +65,10 @@ export default function ProfileHeader() {
6465
}, [isCurrentUser, isKycVerified]);
6566

6667
const dispatch = useDispatch();
68+
6769
const triggerKYCVerification = () => {
6870
dispatch(openVerificationModal({}));
71+
dispatch(toggleBodyScrolling(true))
6972
};
7073

7174
const { canConnectDiscord, triggerDiscordOauth } = useDiscordConnect();

0 commit comments

Comments
 (0)