From 22f59ca6196a66ffaebb1eea8dd147cb9fbdb5ff Mon Sep 17 00:00:00 2001 From: Alex Stan <90788596+Ultra980@users.noreply.github.com> Date: Sat, 1 Jun 2024 15:44:25 +0300 Subject: [PATCH] Added a TopicCard component Signed-off-by: Alex Stan <90788596+Ultra980@users.noreply.github.com> --- app/components/form.tsx | 8 +- app/components/topic_card.tsx | 44 ++++++++++ app/sessionconfig/page.tsx | 157 +++++++--------------------------- 3 files changed, 78 insertions(+), 131 deletions(-) create mode 100644 app/components/topic_card.tsx diff --git a/app/components/form.tsx b/app/components/form.tsx index 10c7ac1..71457a0 100644 --- a/app/components/form.tsx +++ b/app/components/form.tsx @@ -27,13 +27,13 @@ const Form = ({ initialData, onSubmit }) => { return (
- {initialData.entries.map( (key, val) => { + {Object.entries( initialData ).map( (key, val) => { return( )})} diff --git a/app/components/topic_card.tsx b/app/components/topic_card.tsx new file mode 100644 index 0000000..112a3fa --- /dev/null +++ b/app/components/topic_card.tsx @@ -0,0 +1,44 @@ + +const TopicCard = ({ title, children, link }) => { + return( +
+ +
+

{title}

+

+ {children} +

+
+
+
+
+

+ Start + now! +

+ + Begin + +
+
+
+
+ ) +} + +export default TopicCard; \ No newline at end of file diff --git a/app/sessionconfig/page.tsx b/app/sessionconfig/page.tsx index d6785fe..172e4b5 100644 --- a/app/sessionconfig/page.tsx +++ b/app/sessionconfig/page.tsx @@ -1,4 +1,5 @@ import { CheckIcon } from '@heroicons/react/20/solid' +import TopicCard from '../components/topic_card' const includedFeatures = [ 'Private forum access', @@ -8,136 +9,38 @@ const includedFeatures = [ ] export default function Example() { + + const cards = [ + ["Learn cybersecurity", "Learning cybersecurity is like becoming a guardian of the digital realm.\nIt's about mastering the art of protecting information, systems, and networks from cyber threats.\nFrom understanding encryption algorithms to detecting malware, every lesson equips you with tools to fortify against cyber-attacks.", "/learn/cybersec" ], + ["Learn geography", "It's cool ig", "/learn/geography"], + ["Learn C++", "Don't.", "/learn/cpp"], + ["Learn C", "Do.", "/learn/c"] + ]; return ( +
-
+
-
- -
-

Learn cybersecurity

-

- Learning cybersecurity is like becoming the guardian of the digital realm. - It's about mastering the art of protecting information, systems, and networks from cyber threats. - From understanding encryption algorithms to detecting malware, every lesson equips you with tools to fortify against cyber-attacks. -

-
-
-
-
-

- Start - now! -

- - Begin - -

- Take a short quiz to begin learning faster than ever -

-
-
-
-
-
- -
-

Learn cybersecurity

-

- Learning cybersecurity is like becoming the guardian of the digital realm. - It's about mastering the art of protecting information, systems, and networks from cyber threats. - From understanding encryption algorithms to detecting malware, every lesson equips you with tools to fortify against cyber-attacks. -

-
-
-
-
-

- Start - now! -

- - Begin - -

- Take a short quiz to begin learning faster than ever -

-
-
-
-
-
- -
-

Learn cybersecurity

-

- Learning cybersecurity is like becoming the guardian of the digital realm. - It's about mastering the art of protecting information, systems, and networks from cyber threats. - From understanding encryption algorithms to detecting malware, every lesson equips you with tools to fortify against cyber-attacks. -

-
-
-
-
-

- Start - now! -

- - Begin - -

- Take a short quiz to begin learning faster than ever -

-
-
-
-
+ { cards.map((elem) => { + return ({elem[1]}) + })} + {/* + + Learning cybersecurity is like becoming a guardian of the digital realm. + It's about mastering the art of protecting information, systems, and networks from cyber threats. + From understanding encryption algorithms to detecting malware, every lesson equips you with tools to fortify against cyber-attacks. + + + Learning cybersecurity is like becoming a guardian of the digital realm. + It's about mastering the art of protecting information, systems, and networks from cyber threats. + From understanding encryption algorithms to detecting malware, every lesson equips you with tools to fortify against cyber-attacks. + + + Learning cybersecurity is like becoming a guardian of the digital realm. + It's about mastering the art of protecting information, systems, and networks from cyber threats. + From understanding encryption algorithms to detecting malware, every lesson equips you with tools to fortify against cyber-attacks. + + */}
)