From e6da8ec06950e899aa913a3889de982aa51c7131 Mon Sep 17 00:00:00 2001 From: Alfredo Sanzo Date: Tue, 24 Oct 2023 18:45:48 -0300 Subject: [PATCH] first book view --- src/components/book/BookView.tsx | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/components/book/BookView.tsx b/src/components/book/BookView.tsx index 9fc9bdc9..ac5b9911 100644 --- a/src/components/book/BookView.tsx +++ b/src/components/book/BookView.tsx @@ -1,12 +1,12 @@ -import { Typography } from "@mui/material"; +import { Stack, Typography } from "@mui/material"; import { useParams } from "react-router-dom"; import { Book, getBook } from "../../staticData/books"; -import { EmberView } from "../emberView/EmberView"; import { Header } from "../header/Header"; import HomeIcon from '@mui/icons-material/Home'; import { Link } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { PBreadcrumbs } from "../PBreadcrumbs"; +import { Challenge } from "../../staticData/challenges"; const Breadcrumb = (book: Book) => { const {t} = useTranslation("books") @@ -29,6 +29,32 @@ export const BookView = () => { return <>
- + +} + +const ChallengeList = ({book}: {book: Book}) => { + const {t} = useTranslation("books") + return + {t(`${book.id}.title`)} + {book.chapters.map( chapter => + {t(`chapters.${chapter.id}.title`)} + {chapter.groups.map( group => { + var groupTitle = t(`groups.${group.id}.title`) + return + {groupTitle && {groupTitle}} + + {group.challenges.map( challenge => + + )} + + + })} + )} + +} + +const ChallengeCard = ({challenge}:{challenge: Challenge}) => { + const {t} = useTranslation("challenges") + return {t(`${challenge.id}.title`)} } \ No newline at end of file