Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Translations #62

Merged
merged 3 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pages/course/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function getStaticProps({ locale }: StaticProps) {
};
}

export default function Page({ CourseStructure: CourseStructure, courseTranslations }: PageProps) {
export default function Page({ CourseStructure, courseTranslations }: PageProps) {
return (
<DefaultLayout seo={seo}>
<PageHero className="container space-y-3 text-center">
Expand Down Expand Up @@ -80,17 +80,17 @@ export default function Page({ CourseStructure: CourseStructure, courseTranslati
<section className="container max-w-4xl">
{CourseStructure.tracks.map((track, trackIndex) => (
<Fragment key={trackIndex}>
<h2 className="text-4xl">{courseTranslations[track.slug]}</h2>
<h2 className="text-4xl">{courseTranslations[track.slug] || track.title} </h2>
{track.units.map((unit, unitIndex) => (
<Unit
key={unitIndex}
moduleNumber={unitIndex + 1}
title={courseTranslations[unit.slug]}
title={courseTranslations[unit.slug] || unit.title}
>
{unit.lessons.map((lesson, lessonIndex) => (
<Lesson
key={lessonIndex}
title={courseTranslations[lesson.slug]}
title={courseTranslations[lesson.slug] || lesson.title}
href={`/course/${lesson.slug}`}
lessonNumber={lessonIndex + 1}
lab={lesson?.lab}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fetch-course.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CourseStructure, Translations } from '../lib/types';
import { get } from 'fetch-unfucked';

const BRANCH: 'main' | 'draft' = 'main';
const BRANCH: string = 'main';

export const fetchLessonText = async (slug: string, locale?: string): Promise<string> => {
const url = `https://raw.githubusercontent.com/Unboxed-Software/solana-course/${BRANCH}/content${
Expand Down
Loading