Skip to content

Commit 9a9a0f1

Browse files
committed
Merge branch 'dev' of github.com:dacadeorg/frontend-app into dev
2 parents a04ab70 + 9ca3352 commit 9a9a0f1

File tree

9 files changed

+323
-50
lines changed

9 files changed

+323
-50
lines changed

CONTRIBUTING.md

Lines changed: 283 additions & 16 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,23 @@ yarn install
7676
Before running the application locally, the following environment variables are required to be set:
7777

7878
```js
79-
NEXT_PUBLIC_FIREBASE_API_KEY = "AIzaSyDjGCuQB-aOc0qFZPNJTfF9Is-UywXakUg";
80-
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN = "dacade-mvp-1.firebaseapp.com";
81-
NEXT_PUBLIC_FIREBASE_PROJECT_ID = "dacade-mvp-1";
79+
NEXT_PUBLIC_FIREBASE_API_KEY = "AIzaSyAmodim2lJZBradsjx6Zl98hECO7vpo2To";
80+
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN = "dacade-d02d2.firebaseapp.com";
81+
NEXT_PUBLIC_FIREBASE_PROJECT_ID = "dacade-d02d2";
8282
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID = "${config.measurementId}";
83-
NEXT_PUBLIC_FIREBASE_APP_ID = "1:1087159887585:web:67f23902be38515b23f9a0";
83+
NEXT_PUBLIC_FIREBASE_APP_ID = "1:194074425069:web:e519dce8d78a458d8b3ee4";
8484

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

87-
NEXT_PUBLIC_BUGSNAG_API_KEY = "77a1ecc00ef7ab8ac27ac7ebfb353afd";
87+
NEXT_PUBLIC_BUGSNAG_API_KEY = "";
8888
NEXT_PUBLIC_SHOW_LANGUAGE_SELECTOR = true;
8989

90-
NEXT_PUBLIC_DISCORD_CALLBACK_URL = "http://localhost:3000/profile";
91-
NEXT_PUBLIC_DISCORD_CLIENT_ID = "910900810815246346";
92-
NEXT_PUBLIC_DISCORD_OAUTH_BASE_URL = "https://discord.com/oauth2/authorize";
90+
NEXT_PUBLIC_DISCORD_CLIENT_ID = "";
91+
NEXT_PUBLIC_DISCORD_CALLBACK_URL = "https://europe-west1-dacade-d02d2.cloudfunctions.net/api/discord-bot/oauth/callback";
92+
NEXT_PUBLIC_DISCORD_OAUTH_BASE_URL = "https://discord.com/api/oauth2/authorize";
9393
NEXT_PUBLIC_DISCORD_SCOPE = "identify email";
9494

95-
NEXT_PUBLIC_GOOGLE_TRANSLATE_API_KEY = "AIzaSyC6XYHCctzfWaxQK6Lbl9eZ0JUzbATcjpM";
95+
NEXT_PUBLIC_GOOGLE_TRANSLATE_API_KEY = "";
9696

9797
NEXT_PUBLIC_BLOCK_EXPLORER_URL = "https://alfajores.celoscan.io";
9898

public/locales/bg/common.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
"page.protocols.contact.name.2": "Paul Walton",
9090
"page.protocols.contact.title.2": "Business Development",
9191
"page.protocols.contact.email.2": "[email protected]",
92+
"communities.overview.challenges.title": "Предизвикателства",
93+
"communities.overview.challenges.description": "В курсовете на тази общност ще имате възможност да научите за нови технологии, да решавате предизвикателства, да получавате обратна връзка и да печелите награди.",
9294
"communities.overview.challenge": "Creative Challenge",
9395
"communities.overview.chapter": "Chapter Overview",
9496
"communities.overview.learning-modules": "Learning Modules",
@@ -166,8 +168,8 @@
166168
"communities.navigation.language.es": "Spanish",
167169
"communities.overview.courses.title": "Courses",
168170
"communities.overview.courses.description": "In the courses of this community, you will be able to learn about new technologies, solve challenges, get feedback and earn bounties.",
169-
"communities.overview.scoreboard.title": "Scoreboard",
170-
"communities.overview.scoreboard.description": "On the scoreboard, you can see which users have accumulated the most reputation by giving valuable feedback to their peers.",
171+
"communities.overview.scoreboard.title": "Табло за резултати",
172+
"communities.overview.scoreboard.description": "На таблото можете да видите кои потребители са натрупали най-много репутация, като предоставят ценни обратни връзки на своите колеги.",
171173
"communities.scoreboard.empty-state.title": "Няма оценки за тази категория.",
172174
"communities.card.estimated": "Estimated Time",
173175
"communities.card.earn": "Earn rewards",

public/locales/en/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
"communities.submissions": "Submissions",
111111
"communities.submission": "Submission",
112112
"communities.challenge.title": "Challenge",
113+
"communities.overview.challenges.title": "Challenges",
114+
"communities.overview.challenges.description": "In the courses of this community, you will be able to learn about new technologies, solve challenges, get feedback, and earn bounties.",
113115
"communities.overview.challenge.title": "Already ready to complete the challenge?",
114116
"communities.overview.challenge.rewards": " Rewards",
115117
"communities.overview.challenge.certificate": "Certificate",

public/locales/es/common.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
"communities.submissions": "Propuestas",
111111
"communities.submission": "Envío",
112112
"communities.challenge.title": "Reto",
113+
"communities.overview.challenges.title": "Desafíos",
114+
"communities.overview.challenges.description": "En los cursos de esta comunidad, podrás aprender sobre nuevas tecnologías, resolver desafíos, recibir retroalimentación y ganar recompensas.",
113115
"communities.overview.challenge.rewards": "Recompensas",
114116
"communities.overview.challenge.certificate": "Certificate",
115117
"communities.overview.challenge.subtitle": "Al completar con éxito",

public/locales/hr/common.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
"page.protocols.contact.name.2": "Paul Walton",
9090
"page.protocols.contact.title.2": "Business Development",
9191
"page.protocols.contact.email.2": "[email protected]",
92+
"communities.overview.challenges.title": "Izazovi",
93+
"communities.overview.challenges.description": "Kroz tečajeve ove zajednice, moći ćete učiti o novim tehnologijama, rješavati izazove, dobivati povratne informacije i zarađivati nagrade.",
9294
"communities.overview.challenge": "Kreativni izazov",
9395
"communities.overview.chapter": "Chapter Overview",
9496
"communities.overview.learning-modules": "Moduli učenja",
@@ -153,8 +155,8 @@
153155
"communities.navigation.language.es": "Spanish",
154156
"communities.overview.courses.title": "Courses",
155157
"communities.overview.courses.description": "In the courses of this community, you will be able to learn about new technologies, solve challenges, get feedback and earn bounties.",
156-
"communities.overview.scoreboard.title": "Scoreboard",
157-
"communities.overview.scoreboard.description": "On the scoreboard, you can see which users have accumulated the most reputation by giving valuable feedback to their peers.",
158+
"communities.overview.scoreboard.title": "Rezultatska ploča",
159+
"communities.overview.scoreboard.description": "Na ploči rezultata možete vidjeti koji su korisnici stekli najviše reputacije pružanjem vrijednih povratnih informacija svojim kolegama.",
158160
"communities.scoreboard.empty-state.title": "Nema bodova za ovu kategoriju.",
159161
"communities.card.estimated": "Estimated Time",
160162
"communities.card.earn": "Earn rewards",

src/components/sections/communities/overview/Sidebar.tsx

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useSelector } from "@/hooks/useTypedSelector";
22
import Link from "next/link";
3-
import { useRouter } from 'next/router';
3+
import { useRouter } from "next/router";
4+
import { useTranslation } from "next-i18next";
45

56
/**
67
* @interface SidebarProps
@@ -16,6 +17,7 @@ export default function Sidebar(): JSX.Element {
1617
const currentCommunity = useSelector((state) => state.communities.current);
1718
const hasCurrentCommunity = !!currentCommunity; // Check if currentCommunity exists
1819
const router = useRouter();
20+
const { t } = useTranslation();
1921

2022
/**
2123
* Checks if the given link is the active (current) route.
@@ -26,30 +28,22 @@ export default function Sidebar(): JSX.Element {
2628
return router.asPath === link;
2729
};
2830

29-
const scoreboardLink = hasCurrentCommunity
30-
? `/communities/${currentCommunity.slug}/scoreboard`
31-
: "";
31+
const scoreboardLink = hasCurrentCommunity ? `/communities/${currentCommunity.slug}/scoreboard` : "";
3232
const mainLink = hasCurrentCommunity ? `/communities/${currentCommunity.slug}` : "";
3333

3434
return (
3535
<div className="flex flex-col divide-y divide-solid divide-gray-100 w-full text-gray-700 space-y-6">
3636
<Link href={mainLink}>
3737
<div className={isActive(mainLink) ? "" : "opacity-80"}>
38-
<div className="font-medium text-.5xl leading-snug">Challenges</div>
39-
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2 mb-6 md:mb-0">
40-
In the courses of this community, you will be able to learn about new
41-
technologies, solve challenges, get feedback, and earn bounties.
42-
</div>
38+
<div className="font-medium text-.5xl leading-snug">{t("communities.overview.challenges.title")}</div>
39+
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2 mb-6 md:mb-0">{t("communities.overview.challenges.description")} </div>
4340
</div>
4441
</Link>
4542
{hasCurrentCommunity && (
4643
<Link href={scoreboardLink}>
4744
<div className={isActive(scoreboardLink) ? "pt-5" : "opacity-80 md:block hidden scroll-smooth pt-5"}>
48-
<div className="font-medium text-.5xl leading-snug">Scoreboard</div>
49-
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2">
50-
On the scoreboard, you can see which users have accumulated the most
51-
reputation by giving valuable feedback to their peers.
52-
</div>
45+
<div className="font-medium text-.5xl leading-snug">{t("communities.overview.scoreboard.title")}</div>
46+
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2 mb-6 md:mb-0">{t("communities.overview.scoreboard.description")}</div>
5347
</div>
5448
</Link>
5549
)}

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,26 @@ import { wrapper } from "@/store";
1010
import { fetchCurrentCommunity } from "@/store/services/community.service";
1111
import { fetchAllChallenges } from "@/store/services/communities/challenges";
1212
import { NotFoundError } from "@/utilities/errors/NotFoundError";
13+
import { fetchAllScoreboards } from "@/store/services/communities/scoreboard.service";
14+
import { useTranslation } from "next-i18next";
15+
1316
export default function Slug(props: {
1417
pageProps: {
1518
community: Community;
1619
challenges: Challenge[];
1720
};
1821
}): ReactElement {
1922
const { community, challenges } = props.pageProps;
23+
const { t } = useTranslation();
2024
return (
2125
<CommunityWrapper>
2226
{challenges.map((challenge) => (
2327
<ChallengeCard key={challenge.id} data={challenge} community={community} />
2428
))}
2529
<div className="md:hidden">
2630
<div className="active md:hidden mb-7 scroll-smooth pt-5">
27-
<div className="font-medium text-.5xl leading-snug">Scoreboard</div>
28-
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2">
29-
On the scoreboard, you can see which users have accumulated the most reputation by giving valuable feedback to their peers.
30-
</div>
31+
<div className="font-medium text-.5xl leading-snug">{t("communities.overview.scoreboard.title")}</div>
32+
<div className="text-sm font-light lg:w-full lg:pr-7 pt-2">{t("communities.overview.scoreboard.description")} </div>
3133
</div>
3234
<Scoreboard />
3335
</div>
@@ -43,16 +45,18 @@ export const getServerSideProps = wrapper.getServerSideProps((store) => async ({
4345
try {
4446
const slug = params?.slug as string;
4547

46-
const [{ data: community }, { data: challenges }, translations] = await Promise.all([
48+
const [{ data: community }, { data: challenges }, { data: scoreboard }, translations] = await Promise.all([
4749
store.dispatch(fetchCurrentCommunity({ slug, locale })),
4850
store.dispatch(fetchAllChallenges({ slug })),
51+
store.dispatch(fetchAllScoreboards({ slug, locale: locale || "en" })),
4952
serverSideTranslations(locale as string),
5053
]);
5154
if (!community || !challenges) throw new NotFoundError();
5255
return {
5356
props: {
5457
community,
5558
challenges,
59+
scoreboard,
5660
...translations,
5761
},
5862
};

src/store/services/communities/scoreboard.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const scoreboardService = createApi({
3737
} catch (err) {
3838
console.error(err);
3939
} finally {
40-
setLoading(false);
40+
dispatch(setLoading(false));
4141
}
4242
},
4343
}),

0 commit comments

Comments
 (0)