diff --git a/src/app/guides/page.tsx b/src/app/guides/page.tsx new file mode 100644 index 0000000..00e3c9e --- /dev/null +++ b/src/app/guides/page.tsx @@ -0,0 +1,65 @@ +import type { Metadata } from "next" +import type { CardResourceProps } from "@/components/card-resource/types" +import GuideFind from "@/components/guides/guide-find" +import GuideContent from "@/components/guides/guide-general" +import { Hero } from "@/components/ui/hero" + +export const metadata: Metadata = { + title: "Guide", + description: "Una raccolta di guide realizzate dai membri del Network", +} + + +const guidesInfo: 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", + }, +] + +export default function GuidePage() { + return ( +
+ + + + + +
+ ) +} diff --git a/src/components/card-resource/index.tsx b/src/components/card-resource/index.tsx new file mode 100644 index 0000000..33a6d02 --- /dev/null +++ b/src/components/card-resource/index.tsx @@ -0,0 +1,44 @@ +"use client" + +import Link from "next/link" +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, + href, + className, +}: CardResourceProps) { + + 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/guide-find.tsx b/src/components/guides/guide-find.tsx new file mode 100644 index 0000000..bcbaf0c --- /dev/null +++ b/src/components/guides/guide-find.tsx @@ -0,0 +1,26 @@ +import { FiLogIn } from "react-icons/fi" +import { CardCaption } from "@/components/card-caption" + + +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 GuideFind() { + return ( + <> + + {/* Mobile */} +
+ +
+ + {/* Desktop */} +
+ +
+ + ); +} \ No newline at end of file diff --git a/src/components/guides/guide-general.tsx b/src/components/guides/guide-general.tsx new file mode 100644 index 0000000..be29422 --- /dev/null +++ b/src/components/guides/guide-general.tsx @@ -0,0 +1,33 @@ +import { CardResource } from "../card-resource" +import type { GuideContentMobileProps } from "./types" + +export default function GuideContent({ title, guides }: GuideContentMobileProps) { + return ( +
+
+ + {/* Desktop Grid */} +
+
+

{title}

+
+
+ {guides.map((guide) => ( + + ))} +
+
+ + {/* Mobile Carousel */} +
+
+

{title}

+ {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/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} + + ) +}