From 7106ea4fa6c19f25b7430761aeec566954741fba Mon Sep 17 00:00:00 2001 From: Guillaume Date: Tue, 19 Dec 2023 15:49:34 +0100 Subject: [PATCH] Add playground page --- components/accordion.tsx | 41 ++-- components/footer.tsx | 4 +- components/nav.tsx | 245 +++++++++++++++++------- models/common.model.ts | 8 +- pages/course.tsx | 30 +-- pages/playground.tsx | 399 +++++++++++++++++++++++++++++++++++++++ pages/pro.tsx | 45 +++-- pages/public-roadmap.tsx | 12 +- 8 files changed, 669 insertions(+), 115 deletions(-) create mode 100644 pages/playground.tsx diff --git a/components/accordion.tsx b/components/accordion.tsx index d06f397d..1fa81f43 100644 --- a/components/accordion.tsx +++ b/components/accordion.tsx @@ -58,17 +58,21 @@ const Accordion: FunctionComponent<{ - {dataItem.title} - + dangerouslySetInnerHTML={{ __html: dataItem.title }} + >
- {Array.isArray(dataItem.text) && ( + {(Array.isArray(dataItem.content) || + dataItem.count !== undefined) && ( - {dataItem.text.length}{' '} - {dataItem.text.length > 1 - ? counterSuffix.plural - : counterSuffix.singular} + {Array.isArray(dataItem.content) + ? dataItem.content.length + : dataItem.count}{' '} + {(Array.isArray(dataItem.content) + ? dataItem.content.length + : dataItem.count) > 1 + ? counterSuffix?.plural + : counterSuffix?.singular} )}
@@ -78,13 +82,12 @@ const Accordion: FunctionComponent<{ className={`accordion-collapse ${ accordionItemState ? '' : 'collapse' }`} - id='helpOne' aria-labelledby={`accordionContent${dataGroupIndex}${dataItemIndex}`} data-bs-parent={`#accordion${dataGroupIndex}${dataItemIndex}`} > - {Array.isArray(dataItem.text) && ( + {Array.isArray(dataItem.content) && (
    - {dataItem.text.map((textItem, textItemIndex) => { + {dataItem.content.map((textItem, textItemIndex) => { return (
  1. )} - {!Array.isArray(dataItem.text) && ( -
    - )} + {!Array.isArray(dataItem.content) && + typeof dataItem.content === 'string' && ( +
    + )} + {!Array.isArray(dataItem.content) && + typeof dataItem.content !== 'string' && + dataItem.content} ); diff --git a/components/footer.tsx b/components/footer.tsx index 17064d72..f3e61f28 100644 --- a/components/footer.tsx +++ b/components/footer.tsx @@ -188,11 +188,11 @@ const Footer: FunctionComponent<{
  2. - Status + Services status
  3. -
    Tools
    +
    Apps