diff --git a/src/app/associations/page.tsx b/src/app/associations/page.tsx index e0553bb..df87e64 100644 --- a/src/app/associations/page.tsx +++ b/src/app/associations/page.tsx @@ -12,6 +12,7 @@ import { FiYoutube, } from "react-icons/fi" import AccordionAssociation from "@/components/accordion-association" +import { Hero } from "@/components/ui/hero" import esnLogo from "../../../public/logos/esn.svg" const accordionItems = [ @@ -158,19 +159,11 @@ const accordionItems = [ export default function AssociationsPage() { return ( -
-
-
-

- Associazioni -

-

- Scopri le associazioni studentesche del Politecnico -

-
-
- -
+
+ + +
+
) diff --git a/src/app/guides/page.tsx b/src/app/guides/page.tsx new file mode 100644 index 0000000..e707b52 --- /dev/null +++ b/src/app/guides/page.tsx @@ -0,0 +1,105 @@ +import { FiLogIn } from "react-icons/fi" +import { CardCaption } from "@/components/card-caption" +import type { CardResourceProps } from "@/components/card-resource/types" +import GuideContent from "@/components/guides/content" +import { GuideContentMobile } from "@/components/guides/content-mobile" +import { Hero } from "@/components/ui/hero" + +const guidesInfo = { + title: "Le guide per Ingegneria Informatica", + description: "Rimani aggiornato sulle idee appena condivise dagli studenti del Politecnico", + guides: [ + { + text: "Corsi a scelta Primo Anno", + }, + { + text: "Corsi a scelta Secondo Anno", + }, + { + text: "Corsi a scelta Terzo Anno", + }, + ], +} + +const guidesGeneral = { + title: "Le guide generali", + description: "Consulta le guide generali per orientarti al meglio nella vita universitaria", + guides: [ + { + text: "Guida a Webex", + }, + { + text: "Guida alla connessione alla rete del Polimi", + }, + ], +} + +const guidesInfoMobile: CardResourceProps[] = [ + { + title: "Chimica Generale", + description: "È un esame che tratta tutti argomenti già visti in qualsiasi liceo scientifico...", + tag: { + text: "Teorico", + variant: "primary", + }, + author: "Giulia M.", + date: "Ott 24", + href: "/guides", + }, + { + title: "Chimica", + description: "È un esame che tratta tutti argomenti già visti in qualsiasi liceo scientifico...", + tag: [ + { + text: "Teorico", + variant: "primary", + }, + { + text: "2 Anno", + variant: "secondary", + }, + ], + author: "Giulia M.", + date: "Ott 24", + href: "/guides", + }, + { + title: "Generale", + description: "È un esame che tratta tutti argomenti già visti in qualsiasi liceo scientifico...", + tag: { + text: "Teorico", + variant: "primary", + }, + author: "Giulia M.", + date: "Ott 24", + href: "/guides", + }, +] + +const guidesMobile = { + title: "Trova le guide del tuo corso", + caption: "Una raccolta di guide scritte dagli studenti del tuo corso", + icon: FiLogIn, +} + +export default function GuidePage() { + return ( +
+ + + {/* Desktop */} +
+ + + +
+ + {/* Mobile */} +
+ + + +
+
+ ) +} diff --git a/src/components/card-resource/index.tsx b/src/components/card-resource/index.tsx new file mode 100644 index 0000000..8648600 --- /dev/null +++ b/src/components/card-resource/index.tsx @@ -0,0 +1,59 @@ +"use client" + +import Link from "next/link" +import { useState } from "react" +import { FiBookmark } from "react-icons/fi" +import { Card, CardContent, CardTitle } from "@/components/ui/card" +import { Pill } from "@/components/ui/pill" +import { cn } from "@/lib/utils" +import type { CardResourceProps } from "./types" + +export function CardResource({ + tag, + title, + description, + author, + date, + bookmarked: initialBookmarked = false, + href, + className, +}: CardResourceProps) { + const [bookmarked, setBookmarked] = useState(initialBookmarked) + + return ( + + +
+
+ {(Array.isArray(tag) ? tag : [tag]).map((t) => ( + + {t.text} + + ))} +
+ +
+ +
+ {title} + {description} +
+ +
+ {author} + {date} +
+ +
+ ) +} diff --git a/src/components/card-resource/types.ts b/src/components/card-resource/types.ts new file mode 100644 index 0000000..07406f9 --- /dev/null +++ b/src/components/card-resource/types.ts @@ -0,0 +1,17 @@ +import type { PillVariant } from "@/components/ui/pill" + +export type PillTag = { + text: string + variant: PillVariant +} + +export type CardResourceProps = { + tag: PillTag | PillTag[] + title: string + description: string + author: string + date: string + bookmarked?: boolean + href: string + className?: string +} diff --git a/src/components/card-text.tsx b/src/components/card-text.tsx new file mode 100644 index 0000000..7b3ce95 --- /dev/null +++ b/src/components/card-text.tsx @@ -0,0 +1,11 @@ +import { Card, CardContent } from "./ui/card" + +export default function CardText({ text, className }: { text: string; className?: string }) { + return ( + + + {text} + + + ) +} diff --git a/src/components/guides/content-mobile.tsx b/src/components/guides/content-mobile.tsx new file mode 100644 index 0000000..88d49bb --- /dev/null +++ b/src/components/guides/content-mobile.tsx @@ -0,0 +1,14 @@ +import { cn } from "@/lib/utils" +import { CardResource } from "../card-resource" +import type { GuideContentMobileProps } from "./types" + +export function GuideContentMobile({ title, guides, className }: GuideContentMobileProps) { + return ( +
+

{title}

+ {guides.map((guide) => ( + + ))} +
+ ) +} diff --git a/src/components/guides/content.tsx b/src/components/guides/content.tsx new file mode 100644 index 0000000..a157161 --- /dev/null +++ b/src/components/guides/content.tsx @@ -0,0 +1,19 @@ +import CardText from "@/components/card-text" +import { cn } from "@/lib/utils" +import type { GuideContentProps } from "./types" + +export default function GuideContent({ title, description, guides, className }: GuideContentProps) { + return ( +
+
+

{title}

+

{description}

+
+
+ {guides.map((guide) => ( + + ))} +
+
+ ) +} diff --git a/src/components/guides/types.ts b/src/components/guides/types.ts new file mode 100644 index 0000000..b43bb57 --- /dev/null +++ b/src/components/guides/types.ts @@ -0,0 +1,14 @@ +import type { CardResourceProps } from "../card-resource/types" + +export type GuideContentProps = { + title: string + description: string + guides: { text: string }[] + className?: string +} + +export type GuideContentMobileProps = { + title: string + guides: CardResourceProps[] + className?: string +} diff --git a/src/components/home/carousel-mock.tsx b/src/components/home/carousel-mock.tsx deleted file mode 100644 index c4f9758..0000000 --- a/src/components/home/carousel-mock.tsx +++ /dev/null @@ -1,49 +0,0 @@ -"use client" - -import { CardCaption } from "@/components/card-caption" -import { Carousel, CarouselContent, CarouselDots, CarouselItem } from "@/components/ui/carousel" - -const mockCards = [ - { - title: "WeBeepSync", - caption: - "WeBeep Sync è una semplice app, user-friendly e senza compromessi che serve per tenere sincronizzati tutti i tuoi file di WeBeep.", - }, - { - title: "PolimiSchedule", - caption: - "Genera un file iCalendar (.ics) a partire dal formato testuale dell’Orario delle lezioni. Possibilità di importare su Google Calendar.", - }, - { - title: "WiFiLinux", - caption: "Scarica ed esegui lo script Python per attivare la connessione permanente al WiFi Polimi.", - }, - { - title: "The TOL Project", - caption: "Un simulatore gratuito del test di ammissione per le aspiranti matricole di Ingegneria del PoliMi.", - }, -] as const - -// TODO: delete this when merging -export function CarouselMock() { - return ( -
-

- PoliNetwork -

- - - - {mockCards.map((card) => ( - -
- -
-
- ))} -
- -
-
- ) -} diff --git a/src/components/projects/collection.tsx b/src/components/projects/collection.tsx index 81221e0..81c651d 100644 --- a/src/components/projects/collection.tsx +++ b/src/components/projects/collection.tsx @@ -83,7 +83,7 @@ export function Collection() {
-
+
{collectionCards.map((card) => ( ))} diff --git a/src/components/projects/community-news.tsx b/src/components/projects/community-news.tsx index f5881ff..1aa9e9b 100644 --- a/src/components/projects/community-news.tsx +++ b/src/components/projects/community-news.tsx @@ -1,6 +1,7 @@ import { FiCrop } from "react-icons/fi" import { CardCaption } from "../card-caption" import { Carousel, CarouselContent, CarouselDots, CarouselItem } from "../ui/carousel" +import { Hero } from "../ui/hero" const communityCards = [ { @@ -36,14 +37,7 @@ const communityCards = [ export function CommunityNews() { return (
-
-

- Projects -

-

- Esplora e contribuisci ai progetti degli studenti -

-
+
diff --git a/src/components/projects/deprecated.tsx b/src/components/projects/deprecated.tsx index ebff0a9..67a3c07 100644 --- a/src/components/projects/deprecated.tsx +++ b/src/components/projects/deprecated.tsx @@ -47,7 +47,7 @@ export function Deprecated() {
-
+
{communityCards.map((card) => ( ))} diff --git a/src/components/ui/hero.tsx b/src/components/ui/hero.tsx new file mode 100644 index 0000000..d4ebc4b --- /dev/null +++ b/src/components/ui/hero.tsx @@ -0,0 +1,10 @@ +export function Hero({ title, description }: { title: string; description: string }) { + return ( +
+

+ {title} +

+

{description}

+
+ ) +} diff --git a/src/components/ui/pill.tsx b/src/components/ui/pill.tsx new file mode 100644 index 0000000..9c59873 --- /dev/null +++ b/src/components/ui/pill.tsx @@ -0,0 +1,31 @@ +import { cn } from "@/lib/utils" + +export type PillVariant = "primary" | "secondary" | "tertiary" + +const variantClasses: Record = { + primary: "bg-blue-tertiary text-text-accent-lightbg", + secondary: "bg-blue-secondary text-text-accent-darkbg", + tertiary: "bg-blue-primary text-primary", +} + +export function Pill({ + children, + variant = "tertiary", + className, +}: { + children: React.ReactNode + variant?: PillVariant + className?: string +}) { + return ( + + {children} + + ) +}