Skip to content

Commit cc66221

Browse files
committed
fixL resolve merge conflicts
2 parents 36f668e + 0d6c166 commit cc66221

File tree

113 files changed

+5951
-4460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+5951
-4460
lines changed

README.md

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Learning and community are the core principles that dacade approaches with a mul
77
## 1. Requirements
88

99
To run the project, you will need the following:
10+
1011
- Node.js (v16 or higher)
1112
- npm (v6 or higher)
1213

@@ -40,7 +41,38 @@ yarn build
4041
yarn start
4142
```
4243

43-
## 4. Setup
44+
## 4. Features
45+
46+
- authentication feature:
47+
Users can sign up and log in to the platform using their email and password or through their Google
48+
accounts. Firebase Authentication API is used to manage user authentication
49+
50+
- Learning Materials
51+
The platform provides users with access to learning materials, including videos, quizzes, and text-based content. Users can navigate through the materials and track their progress.
52+
53+
- Feedback and Collaboration
54+
Users can provide feedback to each other on their projects through a custom API. The API allows users to comment on each other's work and collaborate on their projects.
55+
56+
- Gamification
57+
The platform features gamification elements, including badges and rewards, to motivate users and encourage participation.
58+
59+
## Running Locally
60+
61+
### 1. Clone Repo
62+
63+
```bash
64+
git clone https://github.com/dacadeorg/dacade-frontend-app.git
65+
```
66+
67+
### 2. Install Dependencies
68+
69+
```bash
70+
yarn install
71+
```
72+
73+
### 3. Configuration
74+
75+
Before running the application locally, the following environment variables are required to be set:
4476

4577
```js
4678
NEXT_PUBLIC_FIREBASE_API_KEY = "AIzaSyDjGCuQB-aOc0qFZPNJTfF9Is-UywXakUg";
@@ -66,20 +98,11 @@ NEXT_PUBLIC_BLOCK_EXPLORER_URL = "https://alfajores.celoscan.io";
6698
NEXT_PUBLIC_IPFS_URL = "https://gateway.pinata.cloud/ipfs/";
6799
```
68100

69-
## 5. Features
101+
### 4. Run App
70102

71-
- authentication feature:
72-
Users can sign up and log in to the platform using their email and password or through their Google
73-
accounts. Firebase Authentication API is used to manage user authentication
74-
75-
- Learning Materials
76-
The platform provides users with access to learning materials, including videos, quizzes, and text-based content. Users can navigate through the materials and track their progress.
77-
78-
- Feedback and Collaboration
79-
Users can provide feedback to each other on their projects through a custom API. The API allows users to comment on each other's work and collaborate on their projects.
80-
81-
- Gamification
82-
The platform features gamification elements, including badges and rewards, to motivate users and encourage participation.
103+
```bash
104+
yarn run dev
105+
```
83106

84107
### User Roles and Privileges
85108

@@ -114,6 +137,7 @@ Contributions to the project are welcome. To contribute, follow these steps:
114137
- Create a new branch for your changes.
115138
- Make your changes and commit them to your branch.
116139
- Submit a pull request to merge your changes into the main branch.
140+
- Follow our contribution guideline document for more information. [Contribution guideline document](CONTRIBUTING.md)
117141

118142
### License
119143

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@types/react": "18.0.28",
2222
"@types/react-dom": "18.0.11",
2323
"@typescript-eslint/eslint-plugin": "^6.3.0",
24-
"@walletconnect/web3-provider": "^1.8.0",
24+
"@web3modal/wagmi": "^3.2.0",
2525
"axios": "^1.3.4",
2626
"classnames": "^2.3.2",
2727
"date-fns": "^2.29.3",
@@ -75,6 +75,8 @@
7575
"unified": "^10.1.2",
7676
"unist-util-visit": "^2.0.0",
7777
"use-onclickoutside": "^0.4.1",
78+
"viem": "^1.18.1",
79+
"wagmi": "^1.4.5",
7880
"web3": "^1.10.0",
7981
"web3modal": "^1.9.12"
8082
},

public/locales/bg/common.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"communities.overview.challenge.objective.title": "Цели на предизвикателството",
107107
"communities.overview.reward.subtitle": "Какво може да получите в тази общност:",
108108
"communities.chapter.objective.subtitle": "Какво може да получите в тази общност:",
109-
"communities.overview.challenge.rewards": "{{count}} Награди",
109+
"communities.overview.challenge.rewards": "Награди",
110110
"communities.overview.challenge.subtitle": "При успешно завършване",
111111
"communities.overview.challenge.expiry": "Срок на изтичане на предизвикателството:",
112112
"communities.overview.challenge.learning.title": "Следните учебни материали ще ви осигурят техническите умения, необходими за успешното справяне с предизвикателството.",
@@ -127,6 +127,7 @@
127127
"communities.challenge.criteria.title": "Rating Rubric",
128128
"communities.challenge.criteria.subtitle": "Следните учебни материали ще ви дадат необходимата техническа експертиза, за да се справите успешно с предизвикателството.",
129129
"communities.challenge.criteria.points": "Points",
130+
"communities.challenge.passing.score.description": "За да спечелите {{coinPlaceholder}} <strong>{{amount}}</strong> <strong>{{token}}</strong>, трябва да получите поне <strong>{{minPoints}}</strong> от <strong>{{maxPoints}}</strong> точки в този предизвикателство.",
130131
"communities.challenge.submission": "заявка",
131132
"communities.challenge.submit": "Изпращане",
132133
"communities.challenge.feedback": "обратна връзка",
@@ -275,6 +276,8 @@
275276
"profile.wallet.payout.request": "Payout request",
276277
"profile.wallet.payout.amount": "Amount",
277278
"profile.wallet.payout.send": "Send request",
279+
"profile.achievement.mintable": "Монетен",
280+
"profile.achievement.mintable-na": "Монетен N/A",
278281
"faq.title": "FAQ",
279282
"faq.subtitle": "If you have any additional questions or need help visit our ",
280283
"faq.discord": "Discord server.",

public/locales/en/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
"communities.challenge.criteria.title": "Rating Rubric",
129129
"communities.challenge.criteria.subtitle": "The following learning materials will equip you with the technical expertise required to successfully address the challenge.",
130130
"communities.challenge.criteria.points": "Points",
131+
"communities.challenge.passing.score.description": "In order to earn {{coinPlaceholder}} <strong>{{amount}}</strong> <strong>{{token}}</strong> you must get at least <strong>{{minPoints}}</strong> out of <strong>{{maxPoints}}</strong> Points in this challenge.",
131132
"communities.challenge.submission": "Submission",
132133
"communities.challenge.submit": "Submit",
133134
"communities.challenge.feedback": "Feedback",
@@ -304,6 +305,7 @@
304305
"profile.achievement.token-id": "Token id",
305306
"profile.achievement.ipfs-metadata": "Metadata",
306307
"profile.achievement.mintable": "Mintable",
308+
"profile.achievement.mintable-na": "Mintable N/A",
307309
"profile.connect.wallet.button": "Connect wallet",
308310
"faq.title": "FAQ",
309311
"faq.subtitle": "If you have any additional questions or need help visit our ",

public/locales/es/common.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
"communities.overview.challenge.title": "¿Ya estás lista para completar el desafío?",
129129
"communities.challenge.criteria.subtitle": "Los siguientes materiales de aprendizaje lo equiparán con la experiencia técnica necesaria para abordar con éxito el desafío.",
130130
"communities.challenge.criteria.points": "Puntos",
131+
"communities.challenge.passing.score.description": "Para ganar {{coinPlaceholder}} <strong>{{amount}}</strong> <strong>{{token}}</strong>, debes obtener al menos <strong>{{minPoints}}</strong> de <strong>{{maxPoints}}</strong> puntos en este desafío.",
131132
"communities.challenge.submission": "Propuesta",
132133
"communities.challenge.submit": "Entregar",
133134
"communities.challenge.feedback": "Feedback",
@@ -150,7 +151,7 @@
150151
"communities.challenge.evaluation.total": "Total",
151152
"communities.challenge.evaluation.points": "Puntos",
152153
"communities.challenge.evaluation.message": "¡Felicidades, ha ganado al menos el 70% de los puntos disponibles!",
153-
"communities.submission.title": "Propuestass",
154+
"communities.submission.title": "Propuestas",
154155
"communities.feedbacks": "Feedbacks",
155156
"communities.navigation.overview": "Vista general",
156157
"communities.navigation.chapters": "Capítulos",
@@ -276,6 +277,8 @@
276277
"profile.wallet.payout.request": "Solicite su pago",
277278
"profile.wallet.payout.amount": "Cantidad",
278279
"profile.wallet.payout.send": "Envíe una solicitud",
280+
"profile.achievement.mintable": "Acuñable",
281+
"profile.achievement.mintable-na": "Acuñable N/A",
279282
"faq.title": "FAQ",
280283
"faq.subtitle": "Si tiene más preguntas o necesita ayuda visite nuestro ",
281284
"faq.discord": "servidor de Discord.",

public/locales/hr/common.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
"communities.overview.challenge.title": "Već ste spremni ispuniti izazov?",
116116
"communities.challenge.criteria.subtitle": "Sljedeći materijali za učenje opremit će vas tehničkom stručnošću potrebnom za uspješno rješavanje izazova.",
117117
"communities.challenge.criteria.points": "bodova",
118+
"communities.challenge.passing.score.description": "U svrhu zarade {{coinPlaceholder}} <strong>{{amount}}</strong> <strong>{{token}}</strong>-ova morate osvojiti barem <strong>{{minPoints}}</strong> od <strong>{{maxPoints}}</strong> bodova u ovom izazovu.",
118119
"communities.challenge.submission": "predaji zadatka",
119120
"communities.challenge.submit": "podnijeti",
120121
"communities.challenge.feedback": "povratnoj informaciji",
@@ -275,6 +276,8 @@
275276
"profile.wallet.payout.request": "Payout request",
276277
"profile.wallet.payout.amount": "Amount",
277278
"profile.wallet.payout.send": "Send request",
279+
"profile.achievement.mintable": "Mintable",
280+
"profile.achievement.mintable-na": "Mintable N/A",
278281
"faq.title": "FAQ",
279282
"faq.subtitle": "If you have any additional questions or need help visit our ",
280283
"faq.discord": "Discord server.",

src/components/banner/PrivacyPolicy.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ export default function PrivacyPolicyBanner(): ReactElement {
3434
if (showBanner)
3535
return (
3636
<div className="fixed bottom-0 left-0 right-0 z-999 flex flex-row justify-center md:justify-between bg-primary">
37-
<div className="text-white py-8 text-center lg:text-base text-sm md:text-lg justify-center md:max-w-none px-6">
37+
<div className="text-white py-8 text-center mx-auto lg:text-base text-sm md:text-lg justify-center md:max-w-none px-6">
3838
{t("signup-page.privacy.text")}{" "}
3939
<Link href="/privacy-policy" className="underline">
4040
{t("signup-page.privacy")}
4141
</Link>
4242
</div>
4343
<div
44-
className="flex absolute lg:relative lg:p-6 md:py-0 lg:justify-center -right-1 -top-1 lg:top-0 lg:right-0 lg:items-center items-center"
44+
className="flex absolute lg:relative lg:p-6 md:py-0 lg:justify-center right-0 top-0 lg:items-center items-center"
4545
onClick={onAcceptCookiesPolicy}
4646
>
47-
<div className="z-50 h-8 lg:w-8 w-5 flex items-center text-white rounded-full lg:border-solid lg:border lg:border-white hover:bg-blue-700 bg-transparent cursor-pointer place-content-center">
47+
<div className="z-50 lg:h-8 h-7 lg:w-8 w-7 flex items-center text-white rounded-full lg:border-solid lg:border lg:border-white hover:bg-blue-700 bg-transparent cursor-pointer place-content-center">
4848
<CloseIcon />
4949
</div>
5050
</div>

src/components/cards/Achievement.tsx

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/* eslint-disable @next/next/no-img-element */
2-
import { ReactElement } from "react";
2+
import { ReactElement, useMemo } from "react";
33

44
import Link from "next/link";
55
import { Certificate } from "@/types/certificate";
6+
import { useTranslation } from "next-i18next";
7+
import classNames from "classnames";
8+
import Checkmark from "@/icons/checkMarkIcon.svg";
69

710
/**
811
* Achievement card props interface
@@ -16,9 +19,22 @@ interface AchievementCardProps {
1619
minting?: boolean;
1720
}
1821

19-
export default function AchievementCard({ data }: AchievementCardProps): ReactElement {
20-
21-
22+
export default function AchievementCard({ data, minting }: AchievementCardProps): ReactElement {
23+
const { t } = useTranslation();
24+
const mintable = useMemo(() => {
25+
return data?.community?.can_mint_certificates;
26+
}, [data]);
27+
28+
const minted = useMemo(() => {
29+
return !!data?.minting?.tx && mintable;
30+
}, [data, mintable]);
31+
32+
const badgeText = useMemo(() => {
33+
if (!mintable) {
34+
return t("profile.achievement.mintable-na");
35+
}
36+
return !minted && !minting ? t("profile.achievement.mintable") : "NFT";
37+
}, [mintable, minted, t]);
2238

2339
const isNotCertificateIcon: boolean = !!data?.metadata?.image?.includes("/img/certificates/");
2440

@@ -28,26 +44,28 @@ export default function AchievementCard({ data }: AchievementCardProps): ReactEl
2844
<div className="flex flex-col h-full">
2945
<div className="flex-grow w-full mx-auto text-left px-7">
3046
<div className="min-h-2xs">
31-
<div
32-
className={`mx-auto relative rounded-full mb-5 ${!isNotCertificateIcon ? "w-20 h-20" : ""}`}
33-
style={{ backgroundColor: isNotCertificateIcon ? data?.community.colors?.cover?.background || data?.community.colors.primary : "" }}
34-
>
35-
<img src={data?.metadata?.image} alt="achievement" />
36-
</div>
47+
<div
48+
className={`mx-auto relative rounded-full mb-5 ${!isNotCertificateIcon ? "w-20 h-20" : ""}`}
49+
style={{ backgroundColor: isNotCertificateIcon ? data?.community.colors?.cover?.background || data?.community.colors.primary : "" }}
50+
>
51+
<img src={data?.metadata?.image} alt="achievement" />
52+
</div>
3753
</div>
38-
39-
<p className="text-sm font-medium text-center pb-5">{data?.metadata?.name}</p>
54+
55+
<p className="text-sm font-medium text-center pb-5">{data?.metadata?.name}</p>
4056
</div>
4157

42-
{/* <div
43-
className={classNames("rounded-b-3.5xl border-t border-solid mt-4 py-4 bort flex flex-none justify-center items-center space-x-1", {
44-
"bg-gray-100": minted,
45-
invisible: !mintable,
46-
})}
47-
>
48-
{minted && <Checkmark />}
49-
<p className="text-base font-normal text-center">{badgeText}</p>
50-
</div> */}
58+
{minting && (
59+
<div
60+
className={classNames("rounded-b-3.5xl border-t border-solid mt-4 py-4 bort flex flex-none justify-center items-center space-x-1", {
61+
"bg-gray-100": minted,
62+
invisible: !mintable,
63+
})}
64+
>
65+
{minted && <Checkmark />}
66+
<p className="text-base font-normal text-center">{badgeText}</p>
67+
</div>
68+
)}
5169
</div>
5270
</Link>
5371
</div>

src/components/cards/Balance.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface BalanceProps {
2727
* @returns {ReactElement}
2828
*/
2929
export default function Balance({ details }: BalanceProps): ReactElement {
30-
const address = details.address ? truncateAddress(details.address, details.token) : null;
30+
const address = details.address && details.token.toUpperCase() !== "DAC" ? truncateAddress(details.address, details.token) : null;
3131

3232
return (
3333
<Link href="/profile/wallets">

src/components/cards/EvaluationCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function EvaluationCard({ evaluation, link = "", last, children }
4747
bordered={!last}
4848
boxLayout={false}
4949
>
50-
<TranslationBox text={evaluation.comment} textCssClasses="text-base md:text-lg leading-normal" defaultLocale={"en"} disabled={false} textContainerCssClasses="" />
50+
<TranslationBox text={evaluation.comment} textCssClasses="text-base md:text-lg leading-normal" defaultLocale="en" disabled={false} />
5151
{children}
5252
</UserCard>
5353
);

0 commit comments

Comments
 (0)