-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add Guides page #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
BIA3IA
wants to merge
19
commits into
main
Choose a base branch
from
bianca/guides
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cb465dc
feat: add GuidePage and CardText component for guide display
BIA3IA 197ee15
feat: implement GuideContent and GuideHero components for guide display
BIA3IA af078c6
refactor: biome check
BIA3IA 9842073
feat: add Hero component and integrate it into Associations, Communit…
BIA3IA f2f6ea3
feat: remove unused CarouselMock component from Home page
BIA3IA c77ef1d
style: format Hero component for improved readability
BIA3IA 184b538
Merge commit '68e769ee4f948e11bfc8ab150bbe06f693bf8490' into bianca/g…
BIA3IA 78c28e0
Merge commit 'c77ef1d8fdf746a62799180d09261fac9b3af2ad' into bianca/g…
BIA3IA 609632f
feat: replace GuideHero component with Hero component in GuidePage
BIA3IA f260477
feat: add CardResource component and enhance GuideContent with classN…
BIA3IA 4a6c438
feat: add GuideContentMobile component and update GuidePage to use it
BIA3IA a6cc210
feat: enhance CardResource component to support Pill tags and add Pil…
BIA3IA 069cacf
fix: correct formatting in guidesInfoMobile and add className prop to…
BIA3IA c1e619e
chore: biome
BIA3IA 6ffa8e2
chore: rabbit
BIA3IA 04d20f6
Merge commit '10801992368bbac02215d04851374c48e6dd5241' into bianca/g…
BIA3IA 9375b18
fix: update Guides link to point to the correct path
BIA3IA e72ef2f
Merge remote-tracking branch 'origin/HEAD' into bianca/guides
BIA3IA 57fe70a
feat: refactor guides structure and layout
itasimo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <section className="flex min-h-screen w-full max-w-350 flex-col gap-32 px-12 pt-58 pb-18 sm:gap-48"> | ||
| <Hero title="Guide" description="Una raccolta di guide realizzate dai membri del Network" /> | ||
|
|
||
| <GuideFind /> | ||
| <GuideContent title="Guide Generali" guides={guidesInfo} /> | ||
|
|
||
| </section> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 ( | ||
| <Card className={cn("h-fit w-full p-6", className)}> | ||
| <Link href={href} className="flex h-full flex-col"> | ||
| <div className="flex items-center justify-between"> | ||
| <div className="flex gap-2"> | ||
| {(Array.isArray(tag) ? tag : [tag]).map((t) => ( | ||
| <Pill key={t.text} variant={t.variant}> | ||
| {t.text} | ||
| </Pill> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| <div className="mt-5 flex flex-1 flex-col gap-2"> | ||
| <CardTitle className="typo-title-large">{title}</CardTitle> | ||
| <CardContent className="typo-body-large line-clamp-3 px-0 text-text-primary">{description}</CardContent> | ||
| </div> | ||
|
|
||
| <div className="typo-body-large mt-12 flex items-center justify-between text-text-secondary"> | ||
| <span>{author}</span> | ||
| <span>{date}</span> | ||
| </div> | ||
| </Link> | ||
| </Card> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { Card, CardContent } from "./ui/card" | ||
|
|
||
| export default function CardText({ text, className }: { text: string; className?: string }) { | ||
| return ( | ||
| <Card className={`h-fit w-full rounded-3xl border-white/50 p-4 ${className || ""}`}> | ||
| <CardContent className="typo-headline-small bg-linear-to-b from-blue-secondary to-blue-primary bg-clip-text px-0 text-center font-normal text-transparent"> | ||
| {text} | ||
| </CardContent> | ||
| </Card> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 */} | ||
| <div className="flex w-full flex-col items-center gap-32 sm:hidden"> | ||
| <CardCaption {...guidesMobile} className="p-6" /> | ||
| </div> | ||
|
|
||
| {/* Desktop */} | ||
| <div className="hidden w-full flex-col gap-2 sm:flex"> | ||
| <CardCaption {...guidesMobile} className="w-full max-w-4xl self-center p-6" /> | ||
| </div> | ||
| </> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import { CardResource } from "../card-resource" | ||
| import type { GuideContentMobileProps } from "./types" | ||
|
|
||
| export default function GuideContent({ title, guides }: GuideContentMobileProps) { | ||
| return ( | ||
| <section className="mx-auto flex min-h-screen max-w-400 flex-col items-center justify-center gap-48 px-4 py-49"> | ||
| <div className="mx-auto flex w-full flex-col gap-14 sm:w-fit"> | ||
|
|
||
| {/* Desktop Grid */} | ||
| <div className="hidden sm:flex w-full flex-col gap-5"> | ||
| <div className="flex flex-col items-center gap-2 "> | ||
| <h3 className="text-start sm:typo-display-medium typo-headline-medium w-full">{title}</h3> | ||
| </div> | ||
| <div className="lg:grid-cols-3 justify-items-center gap-5 grid grid-cols-2"> | ||
| {guides.map((guide) => ( | ||
| <CardResource key={guide.title} {...guide} /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Mobile Carousel */} | ||
| <div className="sm:hidden"> | ||
| <div className="flex w-full flex-col gap-5 text-start"> | ||
| <p className="typo-title-large">{title}</p> | ||
| {guides.map((guide) => ( | ||
| <CardResource key={guide.title} {...guide} /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { cn } from "@/lib/utils" | ||
|
|
||
| export type PillVariant = "primary" | "secondary" | "tertiary" | ||
|
|
||
| const variantClasses: Record<PillVariant, string> = { | ||
| 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 ( | ||
| <span | ||
| className={cn( | ||
| "typo-body-small inline-flex items-center rounded-buttonsM px-3 py-1", | ||
| variantClasses[variant], | ||
| className | ||
| )} | ||
| > | ||
| {children} | ||
| </span> | ||
| ) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.