From 7e9f0485d56020686c7b8f4a34cac08446a49895 Mon Sep 17 00:00:00 2001 From: HackFight Date: Wed, 1 Apr 2026 09:07:29 +0200 Subject: [PATCH 1/3] build: removed auto docker compose up in vscode tasks --- .vscode/tasks.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 3bd57e3..6365677 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -10,9 +10,6 @@ "reveal": "always", "panel": "new" }, - "runOptions": { - "runOn": "folderOpen" - }, "problemMatcher": [] }, { From a6ea3137359783227f39bc207220a8c93e982be9 Mon Sep 17 00:00:00 2001 From: HackFight Date: Thu, 2 Apr 2026 11:53:43 +0200 Subject: [PATCH 2/3] feat: left-aligned items in dropdowns --- src/components/ComiteeBar.tsx | 24 ++++++++++++++---------- src/styles/components/_dropdown.scss | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/components/ComiteeBar.tsx b/src/components/ComiteeBar.tsx index 2c1729d..e4da350 100644 --- a/src/components/ComiteeBar.tsx +++ b/src/components/ComiteeBar.tsx @@ -15,17 +15,21 @@ export default function ComiteeBar({
{comitees .sort((a, b) => - // Sort with Coordinator > Treasurer > others - // Use startsWith so it works in French too (Coordinateur, Trésorier) - a.role.startsWith("Coord") // Coordinator + // Sort with Dictator > Coordinator > Treasurer > others + // Use startsWith so it works in French too (Dictateur, Coordinateur, Trésorier) + a.role.startsWith("Dic") // Dictator ? -1 - : b.role.startsWith("Coord") // Coordinator + : b.role.startsWith("Dic") // Dictator ? 1 - : a.role.startsWith("Tr") // Treasurer - ? -1 - : b.role.startsWith("Tr") // Treasurer - ? 1 - : a.role.localeCompare(b.role), + : a.role.startsWith("Coord") // Coordinator + ? -1 + : b.role.startsWith("Coord") // Coordinator + ? 1 + : a.role.startsWith("Tr") // Treasurer + ? -1 + : b.role.startsWith("Tr") // Treasurer + ? 1 + : a.role.localeCompare(b.role), ) .map((member, i) => ( ); -} +} \ No newline at end of file diff --git a/src/styles/components/_dropdown.scss b/src/styles/components/_dropdown.scss index 6920d47..5b9fdf1 100644 --- a/src/styles/components/_dropdown.scss +++ b/src/styles/components/_dropdown.scss @@ -44,7 +44,7 @@ &.right-align .dropdown-item { text-align: right; - justify-content: end; + justify-content: start; } } From cd41d7bc59ba6cc67487b27c9bcbf7d3567f486d Mon Sep 17 00:00:00 2001 From: HackFight Date: Wed, 8 Apr 2026 16:47:17 +0200 Subject: [PATCH 3/3] feat: using cards on each page now --- src/app/[lang]/articles/[article]/page.tsx | 37 ++++++++++++--- src/app/[lang]/articles/page.tsx | 19 +++----- src/app/[lang]/events/page.tsx | 2 +- src/app/[lang]/projects/page.tsx | 21 +++------ src/components/ArticleCard.tsx | 45 +++++++++++++++++++ src/components/ComiteeBar.tsx | 18 ++++---- src/components/EventCard.tsx | 4 +- src/components/PeopleBar.tsx | 28 ++++++++++++ src/components/ProjectCard.tsx | 28 ++++++++++++ src/locales.ts | 5 ++- .../{_event-card.scss => _cards.scss} | 12 +++-- src/styles/components/_index.scss | 2 +- 12 files changed, 169 insertions(+), 52 deletions(-) create mode 100644 src/components/ArticleCard.tsx create mode 100644 src/components/PeopleBar.tsx create mode 100644 src/components/ProjectCard.tsx rename src/styles/components/{_event-card.scss => _cards.scss} (83%) diff --git a/src/app/[lang]/articles/[article]/page.tsx b/src/app/[lang]/articles/[article]/page.tsx index f5005b2..f4cc666 100644 --- a/src/app/[lang]/articles/[article]/page.tsx +++ b/src/app/[lang]/articles/[article]/page.tsx @@ -1,6 +1,11 @@ +import PeopleBar from "@/components/PeopleBar"; import { directus } from "@/directus"; -import { getTranslation, queryTranslations } from "@/locales"; -import { GameStarArticle } from "@/types/aliases"; +import { getTranslation, useTranslationTable } from "@/locales"; +import { + GameStarArticle, + GameStarArticleMember, + Member, +} from "@/types/aliases"; import { readItems } from "@directus/sdk"; import { notFound } from "next/navigation"; import Markdown from "react-markdown"; @@ -11,12 +16,13 @@ export default async function Article({ params: { article: string; lang: string }; }) { const { lang } = await params; + const tt = await useTranslationTable(lang); const articles = (await directus().request( //@ts-ignore readItems("game_star_articles", { + fields: ["*", { translations: ["*"], authors: [{ members_id: ["*"] }] }], filter: { status: { _eq: "published" }, slug: { _eq: params.article } }, limit: 1, - ...queryTranslations, }), )) as GameStarArticle[]; @@ -29,9 +35,26 @@ export default async function Article({ const translation = getTranslation(article, lang); return ( -
-

{translation.title}

- {translation.content} -
+ <> +
+

{translation.title}

+ {translation.content} +
+ {article.authors?.length === 0 ? null : ( + { + return { + name: (author.members_id as Member).name as string, + surname: (author.members_id as Member).surname as string, + role: tt["author"], + link: (author.members_id as Member).link as string, + image: (author.members_id as Member).picture as string, + }; + }, + )} + /> + )} + ); } diff --git a/src/app/[lang]/articles/page.tsx b/src/app/[lang]/articles/page.tsx index b316524..98d99ae 100644 --- a/src/app/[lang]/articles/page.tsx +++ b/src/app/[lang]/articles/page.tsx @@ -9,6 +9,7 @@ import { readItems, readSingleton } from "@directus/sdk"; import { GameStarArticle } from "@/types/aliases"; import { get } from "http"; import Link from "next/link"; +import ArticleCard from "@/components/ArticleCard"; export default async function Articles({ params, @@ -19,26 +20,20 @@ export default async function Articles({ const tt = await useTranslationTable(lang); let articles = (await directus().request( - //@ts-ignore readItems("game_star_articles", { filter: { status: { _eq: "published" } }, - ...queryTranslations, + fields: ["*", { translations: ["*"], authors: [{ members_id: ["*"] }] }], }), )) as GameStarArticle[]; return (

{capitalize(tt["article"])}s

- {articles.map((article) => ( -
-

- - {getTranslation(article, lang).title} - -

-

{getTranslation(article, lang).description}

-
- ))} +
+ {articles.map((article) => ( + + ))} +
{articles.length === 0 ?

{tt["gamestar.comingSoon"]} !

: null}
); diff --git a/src/app/[lang]/events/page.tsx b/src/app/[lang]/events/page.tsx index 5ef371e..2f8e941 100644 --- a/src/app/[lang]/events/page.tsx +++ b/src/app/[lang]/events/page.tsx @@ -26,7 +26,7 @@ export default async function Events({ params }: { params: { lang: string } }) { return (

{capitalize(tt["event"])}s

-
+
{events.map((event) => ( ))} diff --git a/src/app/[lang]/projects/page.tsx b/src/app/[lang]/projects/page.tsx index e07e817..f69203d 100644 --- a/src/app/[lang]/projects/page.tsx +++ b/src/app/[lang]/projects/page.tsx @@ -1,14 +1,12 @@ import { directus } from "@/directus"; import { capitalize, - getTranslation, queryTranslations, useTranslationTable, } from "@/locales"; -import { readItems, readSingleton } from "@directus/sdk"; +import { readItems } from "@directus/sdk"; import { GameStarProject } from "@/types/aliases"; -import { get } from "http"; -import Link from "next/link"; +import ProjectCard from "@/components/ProjectCard"; export default async function Projects({ params, @@ -29,16 +27,11 @@ export default async function Projects({ return (

{capitalize(tt["project"])}s

- {projects.map((project) => ( -
-

- - {getTranslation(project, lang).title} - -

-

{getTranslation(project, lang).description}

-
- ))} +
+ {projects.map((project) => ( + + ))} +
{projects.length === 0 ?

{tt["gamestar.comingSoon"]} !

: null}
); diff --git a/src/components/ArticleCard.tsx b/src/components/ArticleCard.tsx new file mode 100644 index 0000000..c70cd47 --- /dev/null +++ b/src/components/ArticleCard.tsx @@ -0,0 +1,45 @@ +import { getTranslation, useTranslationTable } from "@/locales"; +import { + GameStarArticle, + GameStarArticleMember, + Member, +} from "@/types/aliases"; +import Link from "next/link"; + +export default async function ArticleCard({ + article, + lang, +}: { + article: GameStarArticle; + lang: string; +}) { + const tt = await useTranslationTable(lang); + + const translation = getTranslation(article, lang); + + let names = (article.authors as GameStarArticleMember[])?.map( + (author) => + (author.members_id as Member).name + + " " + + (author.members_id as Member).surname, + ); + + let start = names.slice(0, -1).join(", "); + let last = names[names.length - 1]; + + let res = start === "" ? ` ${last}` : ` ${start} ${tt["and"]} ${last}`; + + return ( +
+ +
+

{translation.title}

+
+ {article.authors?.length === 0 ? tt["anonymous"] : tt["by"] + res} +
+
+

{translation.description}

+ +
+ ); +} diff --git a/src/components/ComiteeBar.tsx b/src/components/ComiteeBar.tsx index e4da350..6fd632d 100644 --- a/src/components/ComiteeBar.tsx +++ b/src/components/ComiteeBar.tsx @@ -22,14 +22,14 @@ export default function ComiteeBar({ : b.role.startsWith("Dic") // Dictator ? 1 : a.role.startsWith("Coord") // Coordinator - ? -1 - : b.role.startsWith("Coord") // Coordinator - ? 1 - : a.role.startsWith("Tr") // Treasurer - ? -1 - : b.role.startsWith("Tr") // Treasurer - ? 1 - : a.role.localeCompare(b.role), + ? -1 + : b.role.startsWith("Coord") // Coordinator + ? 1 + : a.role.startsWith("Tr") // Treasurer + ? -1 + : b.role.startsWith("Tr") // Treasurer + ? 1 + : a.role.localeCompare(b.role), ) .map((member, i) => ( ); -} \ No newline at end of file +} diff --git a/src/components/EventCard.tsx b/src/components/EventCard.tsx index 28cc562..5f5117e 100644 --- a/src/components/EventCard.tsx +++ b/src/components/EventCard.tsx @@ -15,9 +15,9 @@ export default function EventCard({ minute: "2-digit", }); return ( -
+
-
+

{translation.title}

{start_date}
diff --git a/src/components/PeopleBar.tsx b/src/components/PeopleBar.tsx new file mode 100644 index 0000000..bceebca --- /dev/null +++ b/src/components/PeopleBar.tsx @@ -0,0 +1,28 @@ +import ComiteeCard from "./ComiteeCard"; + +export default function PeopleBar({ + people, +}: { + people: { + name: string; + surname: string; + role: string; + link: string; + image: string; + }[]; +}) { + return ( +
+ {people.map((person, i) => ( + + ))} +
+ ); +} diff --git a/src/components/ProjectCard.tsx b/src/components/ProjectCard.tsx new file mode 100644 index 0000000..a14169b --- /dev/null +++ b/src/components/ProjectCard.tsx @@ -0,0 +1,28 @@ +import { getTranslation, useTranslationTable } from "@/locales"; +import { + GameStarProject, +} from "@/types/aliases"; +import Link from "next/link"; + +export default async function ProjectCard({ + project, + lang, +}: { + project: GameStarProject; + lang: string; +}) { + const tt = await useTranslationTable(lang); + + const translation = getTranslation(project, lang); + + return ( +
+ +
+

{translation.title}

+
+

{translation.description}

+ +
+ ); +} diff --git a/src/locales.ts b/src/locales.ts index 0707e65..d6b850d 100644 --- a/src/locales.ts +++ b/src/locales.ts @@ -1,5 +1,4 @@ import config from "@/../next.config"; -import React, { useContext } from "react"; import { directus } from "./directus"; import { readTranslations } from "@directus/sdk"; @@ -17,7 +16,9 @@ function fullLang(lang: string) { } export async function useTranslationTable(lang: string) { - const tables = (await directus().request(readTranslations({}))).reduce<{ + const tables = ( + await directus().request(readTranslations({ limit: -1 })) + ).reduce<{ [lang: string]: { [key: string]: string }; }>((res, val) => { if (val.language in res) { diff --git a/src/styles/components/_event-card.scss b/src/styles/components/_cards.scss similarity index 83% rename from src/styles/components/_event-card.scss rename to src/styles/components/_cards.scss index 4c86820..3f00571 100644 --- a/src/styles/components/_event-card.scss +++ b/src/styles/components/_cards.scss @@ -1,9 +1,9 @@ -.event-card { +.card { padding: 1em; border: 3px solid #000000; border-radius: 10px; - .event-head { + .card-head { display: flex; justify-content: space-between; align-items: center; @@ -22,15 +22,19 @@ .event-start { font-weight: bold; } + + .authors { + font-weight: bold; + } } -.events-grid { +.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1em; } -.events-list { +.cards-list { display: flex; flex-direction: column; gap: 1em; diff --git a/src/styles/components/_index.scss b/src/styles/components/_index.scss index 6e7dc80..14ab3cc 100644 --- a/src/styles/components/_index.scss +++ b/src/styles/components/_index.scss @@ -4,5 +4,5 @@ @forward "navigation"; @forward "article"; @forward "content"; -@forward "event-card"; @forward "not-found"; +@forward "cards"; \ No newline at end of file