From 1e92ea263b0f5e09e7282b30086fd0795d143c46 Mon Sep 17 00:00:00 2001 From: styrix560 <60841004+styrix560@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:21:57 +0200 Subject: [PATCH 01/15] Added team data --- public/data/team.json | 41 +++++++++++++++++++++++++++++++++++++++ src/utils/async_helper.ts | 25 ++++++++++++++++++++---- 2 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 public/data/team.json diff --git a/public/data/team.json b/public/data/team.json new file mode 100644 index 0000000..5538767 --- /dev/null +++ b/public/data/team.json @@ -0,0 +1,41 @@ +[ + { + "img": "/imgs/online_competition.webp", + "name": "Max Mustermann", + "lastrole": "Competitor", + "skill": "Skill 09", + "andmore": true + }, + { + "name": "Max Mustermann", + "lastrole": "Competitor" + }, + { + "name": "Max Mustermann", + "lastrole": "Competitor" + }, + { + "name": "Max Mustermann", + "lastrole": "Competitor" + }, + { + "name": "Max Mustermann", + "lastrole": "Competitor" + }, + { + "name": "Max Mustermann", + "lastrole": "Competitor" + }, + { + "name": "Max Mustermann", + "lastrole": "Competitor" + }, + { + "name": "Maxine Mustermann", + "lastrole": "Helper" + }, + { + "name": "Maxine Mustermann", + "lastrole": "Helper" + } +] diff --git a/src/utils/async_helper.ts b/src/utils/async_helper.ts index 2639758..b095829 100644 --- a/src/utils/async_helper.ts +++ b/src/utils/async_helper.ts @@ -1,6 +1,23 @@ -import history_file from '../../public/data/history.json'; +import history_file from "../../public/data/history.json"; +import team_file from "../../public/data/team.json"; -export async function load_history(skill: string, language: string): Promise>> { - const history = (history_file as Record) - return Promise.resolve(history[language][skill]) +export async function load_history( + skill: string, + language: string +): Promise>> { + const history = history_file as Record; + return Promise.resolve(history[language][skill]); +} + +interface TeamMember { + name: string; + lastrole: string; + img?: string; + skill?: string; + andmore?: boolean; +} + +export async function load_team(): Promise { + const team = team_file as TeamMember[]; + return Promise.resolve(team); } From d1093c705f96e44e4fc8c4aeb50ae6aa59dae997 Mon Sep 17 00:00:00 2001 From: styrix560 <60841004+styrix560@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:23:06 +0200 Subject: [PATCH 02/15] Added team page --- src/components/team/Person.astro | 40 ++++++++++++++++------------- src/components/team/PersonImage.tsx | 14 ++++++++++ src/components/team/Team.astro | 31 +++++++++++++--------- src/layouts/Layout.astro | 2 +- src/pages/[lang]/our-team.astro | 17 ++++++++++++ 5 files changed, 73 insertions(+), 31 deletions(-) create mode 100644 src/components/team/PersonImage.tsx create mode 100644 src/pages/[lang]/our-team.astro diff --git a/src/components/team/Person.astro b/src/components/team/Person.astro index 32a872d..843e9b9 100644 --- a/src/components/team/Person.astro +++ b/src/components/team/Person.astro @@ -1,29 +1,33 @@ --- import type { PropsOf } from "../../utils/types"; import SocialMediaList from "../social_media/SocialMediaList.astro"; +import { PersonImage } from "./PersonImage"; -type Props = PropsOf & { +type Props = { name: string; - img: string; - info?: string; + role: string; + img?: string; + skill?: string; + andmore?: boolean; }; -const { name, img, info, links = [] } = Astro.props; +const { name, img, role, skill, andmore } = Astro.props; --- -
  • -
    - -
    -
    -

    {name}

    - {info &&

    {info}

    } -
    - +
    + +
    +

    {name}

    +
    +

    + {role} +

    +

    + {andmore && "and more"} +

    +

    + {skill} +

    -
  • + diff --git a/src/components/team/PersonImage.tsx b/src/components/team/PersonImage.tsx new file mode 100644 index 0000000..d679cbf --- /dev/null +++ b/src/components/team/PersonImage.tsx @@ -0,0 +1,14 @@ +export type PersonImageProps = { + img?: string; +}; + +export const PersonImage = ({ img }: PersonImageProps) => { + const padding = !img ? "p-5" : ""; + return ( + + ); +}; diff --git a/src/components/team/Team.astro b/src/components/team/Team.astro index bb0f4d4..aaa8567 100644 --- a/src/components/team/Team.astro +++ b/src/components/team/Team.astro @@ -1,17 +1,24 @@ --- -import type { PropsOf } from "../../utils/types"; +import { load_team } from "../../utils/async_helper"; import Person from "./Person.astro"; -type Props = { - members: PropsOf[]; -}; - -const { members } = Astro.props; +const team = await load_team(); --- -
      - {members.map((member) => )} -
    +
    +
    + { + team.map((member) => ( + + )) + } +
    +
    diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 6b6dfab..460f771 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -22,7 +22,7 @@ const { title, mainClass } = Astro.props; diff --git a/src/pages/[lang]/our-team.astro b/src/pages/[lang]/our-team.astro new file mode 100644 index 0000000..64acbf7 --- /dev/null +++ b/src/pages/[lang]/our-team.astro @@ -0,0 +1,17 @@ +--- +import Hero from "../../components/Hero.astro"; +import Team from "../../components/team/Team.astro"; +import Layout from "../../layouts/Layout.astro"; +import { getStaticLangPaths, updateLang } from "../../routing/lang"; + +export const getStaticPaths = getStaticLangPaths; +updateLang(Astro.url.pathname); +--- + + + + + From 92586840622ab04949fc9fdb59f074739b2b4449 Mon Sep 17 00:00:00 2001 From: styrix560 <60841004+styrix560@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:43:54 +0200 Subject: [PATCH 03/15] Added navigation to team page --- public/locales/de/translation.json | 3 +- public/locales/en/translation.json | 3 +- src/components/Header.astro | 51 +++++++++++++++++++----------- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json index 2431335..2eaa118 100644 --- a/public/locales/de/translation.json +++ b/public/locales/de/translation.json @@ -88,7 +88,8 @@ }, "header": { "home": "Startseite", - "skills": "Unsere Disziplinen" + "skills": "Unsere Disziplinen", + "team": "Unser Team" } }, "legal": { diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index d8aaea3..8517891 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -88,7 +88,8 @@ }, "header": { "home": "Home", - "skills": "Our Skills" + "skills": "Our Skills", + "team": "Our Team" } }, "legal": { diff --git a/src/components/Header.astro b/src/components/Header.astro index 581aa05..a1c3ebe 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -4,15 +4,22 @@ import { buildLink } from "../routing/buildLink"; import { LanguageDropdown } from "./dropdowns/LanguageDropdown"; import { SkillsDropdown } from "./dropdowns/SkillsDropdown"; import load from "astro-icon/lib/utils"; +import { map } from "zod"; export interface NavigationItem { name: string; href: string; } -const home: NavigationItem = { - name: t("layout.header.home"), - href: buildLink("/"), -}; +const navigationItems: NavigationItem[] = [ + { + name: t("layout.header.home"), + href: buildLink("/"), + }, + { + name: t("layout.header.team"), + href: buildLink("/our-team"), + }, +]; ---
    @@ -25,28 +32,36 @@ const home: NavigationItem = { -
    +
    -
    - - {home.name} - +
    + { + navigationItems.map((item) => ( + + {item.name} + + )) + }
    From 900945869c5fca4a457f17abf46452e69d2d11e5 Mon Sep 17 00:00:00 2001 From: styrix560 <60841004+styrix560@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:50:15 +0200 Subject: [PATCH 04/15] Added translation for team page --- public/locales/de/translation.json | 4 ++++ public/locales/en/translation.json | 4 ++++ src/components/team/Person.astro | 3 ++- src/pages/[lang]/our-team.astro | 9 +++++---- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json index 2eaa118..cb286c9 100644 --- a/public/locales/de/translation.json +++ b/public/locales/de/translation.json @@ -182,5 +182,9 @@ "wsc2024": "Skill 09 bei den WorldSkills Lyon 2024" } } + }, + "team": { + "title": "Unser Team", + "more": "und mehr" } } diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 8517891..a58fb57 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -181,5 +181,9 @@ "wsc2024": "Skill 09 at the WorldSkills Lyon 2024" } } + }, + "team": { + "title": "Our Team", + "more": "and more" } } diff --git a/src/components/team/Person.astro b/src/components/team/Person.astro index 843e9b9..3143482 100644 --- a/src/components/team/Person.astro +++ b/src/components/team/Person.astro @@ -2,6 +2,7 @@ import type { PropsOf } from "../../utils/types"; import SocialMediaList from "../social_media/SocialMediaList.astro"; import { PersonImage } from "./PersonImage"; +import { t } from "i18next"; type Props = { name: string; @@ -23,7 +24,7 @@ const { name, img, role, skill, andmore } = Astro.props; {role}

    - {andmore && "and more"} + {andmore && t("team.more")}

    diff --git a/src/pages/[lang]/our-team.astro b/src/pages/[lang]/our-team.astro index 64acbf7..319fe0b 100644 --- a/src/pages/[lang]/our-team.astro +++ b/src/pages/[lang]/our-team.astro @@ -1,17 +1,18 @@ --- import Hero from "../../components/Hero.astro"; -import Team from "../../components/team/Team.astro"; +import TeamPage from "../../components/team/Team.astro"; import Layout from "../../layouts/Layout.astro"; import { getStaticLangPaths, updateLang } from "../../routing/lang"; +import { t } from "i18next"; export const getStaticPaths = getStaticLangPaths; updateLang(Astro.url.pathname); --- - + - + From 3c12106f6f842caf8c91ac2fd6eb01be6148046f Mon Sep 17 00:00:00 2001 From: styrix560 <60841004+styrix560@users.noreply.github.com> Date: Mon, 12 Aug 2024 11:28:01 +0200 Subject: [PATCH 05/15] Use proper format for team data --- public/data/team.json | 28 ++++++++++++++++++---------- src/components/team/Person.astro | 15 +++++---------- src/components/team/Team.astro | 4 ++-- src/utils/async_helper.ts | 8 ++++---- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/public/data/team.json b/public/data/team.json index 5538767..b568529 100644 --- a/public/data/team.json +++ b/public/data/team.json @@ -2,40 +2,48 @@ { "img": "/imgs/online_competition.webp", "name": "Max Mustermann", - "lastrole": "Competitor", + "lastRole": "Competitor", "skill": "Skill 09", - "andmore": true + "hasMultipleRoles": true }, { "name": "Max Mustermann", - "lastrole": "Competitor" + "lastRole": "Competitor", + "hasMultipleRoles": false }, { "name": "Max Mustermann", - "lastrole": "Competitor" + "lastRole": "Competitor", + "hasMultipleRoles": false }, { "name": "Max Mustermann", - "lastrole": "Competitor" + "lastRole": "Competitor", + "hasMultipleRoles": false }, { "name": "Max Mustermann", - "lastrole": "Competitor" + "lastRole": "Competitor", + "hasMultipleRoles": false }, { "name": "Max Mustermann", - "lastrole": "Competitor" + "lastRole": "Competitor", + "hasMultipleRoles": false }, { "name": "Max Mustermann", - "lastrole": "Competitor" + "lastRole": "Competitor", + "hasMultipleRoles": false }, { "name": "Maxine Mustermann", - "lastrole": "Helper" + "lastRole": "Helper", + "hasMultipleRoles": false }, { "name": "Maxine Mustermann", - "lastrole": "Helper" + "lastRole": "Helper", + "hasMultipleRoles": false } ] diff --git a/src/components/team/Person.astro b/src/components/team/Person.astro index 3143482..e80b689 100644 --- a/src/components/team/Person.astro +++ b/src/components/team/Person.astro @@ -1,18 +1,13 @@ --- +import { TeamMember } from "../../utils/async_helper"; import type { PropsOf } from "../../utils/types"; import SocialMediaList from "../social_media/SocialMediaList.astro"; import { PersonImage } from "./PersonImage"; import { t } from "i18next"; -type Props = { - name: string; - role: string; - img?: string; - skill?: string; - andmore?: boolean; -}; +type Props = TeamMember; -const { name, img, role, skill, andmore } = Astro.props; +const { name, img, lastRole, skill, hasMultipleRoles } = Astro.props; ---

    @@ -21,10 +16,10 @@ const { name, img, role, skill, andmore } = Astro.props;

    {name}

    - {role} + {lastRole}

    - {andmore && t("team.more")} + {hasMultipleRoles && t("team.more")}

    diff --git a/src/components/team/Team.astro b/src/components/team/Team.astro index aaa8567..f37cf17 100644 --- a/src/components/team/Team.astro +++ b/src/components/team/Team.astro @@ -14,9 +14,9 @@ const team = await load_team(); )) } diff --git a/src/utils/async_helper.ts b/src/utils/async_helper.ts index b095829..8aa960c 100644 --- a/src/utils/async_helper.ts +++ b/src/utils/async_helper.ts @@ -9,12 +9,12 @@ export async function load_history( return Promise.resolve(history[language][skill]); } -interface TeamMember { +export interface TeamMember { name: string; - lastrole: string; - img?: string; + lastRole: string; skill?: string; - andmore?: boolean; + img?: string; + hasMultipleRoles: boolean; } export async function load_team(): Promise { From 8d9276ef8a45b7a7bc1a08ce9996e71fa1b8f185 Mon Sep 17 00:00:00 2001 From: styrix560 <60841004+styrix560@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:56:43 +0200 Subject: [PATCH 06/15] Improve image directory structure --- public/{img => imgs/bg}/hero-bg.jpg | Bin public/imgs/{ => roadmap}/aec.webp | Bin public/imgs/{ => roadmap}/germanChampionship.webp | Bin public/imgs/{ => roadmap}/online_competition.webp | Bin public/imgs/{ => roadmap}/registration.webp | Bin public/{img => imgs/wsg}/wsg_hands.svg | 0 public/{img => imgs/wsg}/wsg_hands_white.svg | 0 public/{img => imgs/wsg}/wsg_horizontal.svg | 0 src/components/Footer.astro | 6 +++++- src/components/Header.astro | 2 +- src/components/skill/SkillRoadmap.astro | 10 +++++----- src/components/team/PersonImage.tsx | 2 +- src/pages/[lang]/index.astro | 2 +- 13 files changed, 13 insertions(+), 9 deletions(-) rename public/{img => imgs/bg}/hero-bg.jpg (100%) rename public/imgs/{ => roadmap}/aec.webp (100%) rename public/imgs/{ => roadmap}/germanChampionship.webp (100%) rename public/imgs/{ => roadmap}/online_competition.webp (100%) rename public/imgs/{ => roadmap}/registration.webp (100%) rename public/{img => imgs/wsg}/wsg_hands.svg (100%) rename public/{img => imgs/wsg}/wsg_hands_white.svg (100%) rename public/{img => imgs/wsg}/wsg_horizontal.svg (100%) diff --git a/public/img/hero-bg.jpg b/public/imgs/bg/hero-bg.jpg similarity index 100% rename from public/img/hero-bg.jpg rename to public/imgs/bg/hero-bg.jpg diff --git a/public/imgs/aec.webp b/public/imgs/roadmap/aec.webp similarity index 100% rename from public/imgs/aec.webp rename to public/imgs/roadmap/aec.webp diff --git a/public/imgs/germanChampionship.webp b/public/imgs/roadmap/germanChampionship.webp similarity index 100% rename from public/imgs/germanChampionship.webp rename to public/imgs/roadmap/germanChampionship.webp diff --git a/public/imgs/online_competition.webp b/public/imgs/roadmap/online_competition.webp similarity index 100% rename from public/imgs/online_competition.webp rename to public/imgs/roadmap/online_competition.webp diff --git a/public/imgs/registration.webp b/public/imgs/roadmap/registration.webp similarity index 100% rename from public/imgs/registration.webp rename to public/imgs/roadmap/registration.webp diff --git a/public/img/wsg_hands.svg b/public/imgs/wsg/wsg_hands.svg similarity index 100% rename from public/img/wsg_hands.svg rename to public/imgs/wsg/wsg_hands.svg diff --git a/public/img/wsg_hands_white.svg b/public/imgs/wsg/wsg_hands_white.svg similarity index 100% rename from public/img/wsg_hands_white.svg rename to public/imgs/wsg/wsg_hands_white.svg diff --git a/public/img/wsg_horizontal.svg b/public/imgs/wsg/wsg_horizontal.svg similarity index 100% rename from public/img/wsg_horizontal.svg rename to public/imgs/wsg/wsg_horizontal.svg diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 56d4560..c9bbe59 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -30,7 +30,11 @@ const socials: Social[] = [