From 1078f07bae562acde20c73ba711263385346578e Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Thu, 20 Oct 2022 13:40:58 +0200 Subject: [PATCH] More about me --- data/skills.json | 14 ++++++++++++++ pages/me.tsx | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 data/skills.json diff --git a/data/skills.json b/data/skills.json new file mode 100644 index 0000000..743e207 --- /dev/null +++ b/data/skills.json @@ -0,0 +1,14 @@ +{ + "cards": [ + { + "title": "Web Technologies", + "skillBars": [ + { + "name": "JavaScript/TypeScript", + "icons": ["FileJs", "FileTs"], + "pct": 100 + } + ] + } + ] +} \ No newline at end of file diff --git a/pages/me.tsx b/pages/me.tsx index 22482ac..2be242f 100644 --- a/pages/me.tsx +++ b/pages/me.tsx @@ -1,10 +1,53 @@ import type { NextPage } from "next"; import Layout from "../components/Blog/Layout"; +import * as phosphorIcons from "phosphor-react"; import styles from "../styles/Blog/AboutMe.module.scss"; +import skills from "../data/skills.json"; -const SkillBar: NextPage<{ skill: string, color: string, pct: number }> = ({skill, color, pct}) => { - return <>; +interface Skill { + name: string; + icons: string[]; + pct: number; +} + +interface AdditionalSkills { + name: string; + icon: string; +} + +interface SkillCard { + title: string; + skillBars: Skill[]; + additional?: AdditionalSkills[]; +} + + +interface SkillSet { + cards: SkillCard[]; + additional: AdditionalSkills[]; +} + +const getIcon = (iconName: string, key?: number) => { + const Icon = phosphorIcons[iconName as keyof typeof phosphorIcons] as any; + if (!Icon) return null; + else return ; +}; + +const SkillBar: NextPage<{ skill: Skill }> = ({ skill }) => { + return
+
{skill.name}{skill.icons.map(getIcon)}
+
{skill.pct}%
+
; +}; + +const SkillCard: NextPage<{ card: SkillCard }> = ({ card }) => { + return
+

{card.title}

+ {card.skillBars.map((skill, i) => + + )} +
; }; const AboutMe: NextPage = () => { @@ -19,6 +62,7 @@ const AboutMe: NextPage = () => { I'm currently studying Information Systems Engineering at the TU Dresden
Currently I'm {age} years old.

+ {skills.cards.map((card, i) => )} ; };