-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add guides structure #169
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
Open
BIA3IA
wants to merge
3
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.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
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
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 |
|---|---|---|
| @@ -1,11 +1,14 @@ | ||
| import type { Metadata } from "next" | ||
| import { SchoolStep } from "@/components/groups/school-step" | ||
| import { SchoolStep } from "@/components/wizard/school-step" | ||
| import { createStepHref } from "@/utils/step-href" | ||
|
|
||
| const stepHref = createStepHref("/groups/didattica") | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Gruppi Didattici", | ||
| description: "Trova i gruppi Telegram e WhatsApp del tuo corso di studi, partendo dalla tua scuola.", | ||
| } | ||
|
|
||
| export default function DidatticaWizard() { | ||
| return <SchoolStep /> | ||
| return <SchoolStep caption="Troviamo il tuo gruppo partendo dalla base!" landingHref="/groups" stepHref={stepHref} /> | ||
| } |
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 type { Metadata } from "next" | ||
| import { GuidesResult } from "@/components/guides/guides-result" | ||
| import { getLevel, getSchool } from "@/components/wizard/constants" | ||
| import { humanizeSlug } from "@/utils/labels" | ||
|
|
||
| export const dynamic = "force-dynamic" | ||
|
|
||
| export async function generateMetadata({ | ||
| params, | ||
| }: { | ||
| params: Promise<{ school: string; level: string; course: string }> | ||
| }): Promise<Metadata> { | ||
| const { school: schoolSlug, level: levelSlug, course } = await params | ||
| const school = getSchool(schoolSlug) | ||
| const level = getLevel(schoolSlug, levelSlug) | ||
| if (!school || !level) return {} | ||
|
|
||
| const courseName = humanizeSlug(course) | ||
|
|
||
| return { | ||
| title: `${courseName} - Guide`, | ||
| description: `Guide per ${courseName}, ${level.name} alla ${school.name}.`, | ||
| } | ||
| } | ||
|
|
||
| export default async function GuidesResultPage({ | ||
| params, | ||
| }: { | ||
| params: Promise<{ school: string; level: string; course: string }> | ||
| }) { | ||
| const { school, level, course } = await params | ||
| return <GuidesResult school={school} level={level} course={course} /> | ||
| } |
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,39 @@ | ||
| import type { Metadata } from "next" | ||
| import { getLevel, getSchool } from "@/components/wizard/constants" | ||
| import { CourseStep } from "@/components/wizard/course-step" | ||
| import type { CourseSearchParams } from "@/components/wizard/types" | ||
| import { createStepHref } from "@/utils/step-href" | ||
|
|
||
| export const dynamic = "force-dynamic" | ||
|
|
||
| const stepHref = createStepHref("/guides/corso") | ||
|
|
||
| export async function generateMetadata({ | ||
| params, | ||
| }: { | ||
| params: Promise<{ school: string; level: string }> | ||
| }): Promise<Metadata> { | ||
| const { school: schoolSlug, level: levelSlug } = await params | ||
| const school = getSchool(schoolSlug) | ||
| const level = getLevel(schoolSlug, levelSlug) | ||
| if (!school || !level) return {} | ||
|
|
||
| return { | ||
| title: `${level.name} - ${school.name}`, | ||
| description: `Trova le guide del tuo corso di ${level.name.toLowerCase()} alla ${school.name}.`, | ||
| } | ||
| } | ||
|
|
||
| export default async function GuidesCoursePage({ | ||
| params, | ||
| searchParams, | ||
| }: { | ||
| params: Promise<{ school: string; level: string }> | ||
| searchParams: Promise<CourseSearchParams> | ||
| }) { | ||
| const { school, level } = await params | ||
| const { campus, lang } = await searchParams | ||
| return ( | ||
| <CourseStep school={school} level={level} campus={campus} lang={lang} landingHref="/guides" stepHref={stepHref} /> | ||
| ) | ||
| } |
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,22 @@ | ||
| import type { Metadata } from "next" | ||
| import { getSchool } from "@/components/wizard/constants" | ||
| import { LevelStep } from "@/components/wizard/level-step" | ||
| import { createStepHref } from "@/utils/step-href" | ||
|
|
||
| const stepHref = createStepHref("/guides/corso") | ||
|
|
||
| export async function generateMetadata({ params }: { params: Promise<{ school: string }> }): Promise<Metadata> { | ||
| const { school: schoolSlug } = await params | ||
| const school = getSchool(schoolSlug) | ||
| if (!school) return {} | ||
|
|
||
| return { | ||
| title: school.name, | ||
| description: `Trova le guide della ${school.name}.`, | ||
| } | ||
| } | ||
|
|
||
| export default async function GuidesLevelPage({ params }: { params: Promise<{ school: string }> }) { | ||
| const { school } = await params | ||
| return <LevelStep school={school} landingHref="/guides" stepHref={stepHref} /> | ||
| } |
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 { Metadata } from "next" | ||
| import { SchoolStep } from "@/components/wizard/school-step" | ||
| import { createStepHref } from "@/utils/step-href" | ||
|
|
||
| const stepHref = createStepHref("/guides/corso") | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Guide del tuo Corso", | ||
| description: "Trova le guide del tuo corso di studi, partendo dalla tua scuola.", | ||
| } | ||
|
|
||
| export default function GuidesCorsoWizard() { | ||
| return <SchoolStep caption="Troviamo la tua guida partendo dalla base!" landingHref="/guides" stepHref={stepHref} /> | ||
| } |
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 type { Metadata } from "next" | ||
| import { GeneralGuides } from "@/components/guides/general-guides" | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Guide Generali", | ||
| description: "Le guide generali del Politecnico di Milano.", | ||
| } | ||
|
|
||
| export default function GuidesGeneraliPage() { | ||
| return <GeneralGuides /> | ||
| } |
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,55 @@ | ||
| import type { Metadata } from "next" | ||
| import { FiBook, FiFileText } from "react-icons/fi" | ||
| import { CardIcon } from "@/components/card-icon" | ||
|
|
||
| const guides = [ | ||
| { | ||
| title: "Guide Generali", | ||
| caption: "Informazioni utili su segreterie, servizi, immatricolazione e vita al Politecnico.", | ||
| href: "/guides/generali", | ||
| icon: FiFileText, | ||
| cta: "Esplora", | ||
| }, | ||
| { | ||
| title: "Guide del tuo Corso", | ||
| caption: "Piani di studio, esami e tutto ciò che riguarda il tuo corso di studi.", | ||
| href: "/guides/corso", | ||
| icon: FiBook, | ||
| cta: "Inizia", | ||
| }, | ||
| ] as const | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "Guide", | ||
| description: "Esplora le guide del Politecnico di Milano, da quelle generali a quelle del tuo corso di studi.", | ||
| } | ||
|
|
||
| export default function GuidesHome() { | ||
| return ( | ||
| <main className="w-full"> | ||
| <div className="flex min-h-svh flex-col items-center gap-16 px-6 py-64 md:gap-20 md:py-49"> | ||
| <div className="flex w-full flex-col items-center gap-5 text-center"> | ||
| <h2 className="typo-display-large md:typo-display-extralarge w-fit bg-linear-to-b from-text-primary to-text-secondary bg-clip-text py-4 text-transparent md:py-14"> | ||
| Guide | ||
| </h2> | ||
| </div> | ||
|
|
||
| <div className="flex w-full flex-col items-center justify-center gap-4 md:flex-row md:gap-13"> | ||
| {guides.map((guide) => ( | ||
| <CardIcon | ||
| key={guide.title} | ||
| title={guide.title} | ||
| description={guide.caption} | ||
| href={guide.href} | ||
| icon={guide.icon} | ||
| cta={guide.cta} | ||
| align="start" | ||
| className="w-full max-w-108" | ||
| size="compact" | ||
| /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </main> | ||
| ) | ||
| } |
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
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
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
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
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 @@ | ||
| export const LOREM_GUIDES = [ | ||
| { | ||
| value: "lorem-ipsum-dolor-sit-amet", | ||
| trigger: "Lorem ipsum dolor sit amet", | ||
| content: | ||
| "Consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.", | ||
| }, | ||
| { | ||
| value: "ut-enim-ad-minim-veniam", | ||
| trigger: "Ut enim ad minim veniam", | ||
| content: | ||
| "Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.", | ||
| }, | ||
| { | ||
| value: "duis-aute-irure-dolor", | ||
| trigger: "Duis aute irure dolor", | ||
| content: | ||
| "In reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.", | ||
| }, | ||
| { | ||
| value: "excepteur-sint-occaecat", | ||
| trigger: "Excepteur sint occaecat", | ||
| content: | ||
| "Cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt.", | ||
| }, | ||
| ] | ||
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,39 @@ | ||
| import Link from "next/link" | ||
| import { FiArrowLeft, FiX } from "react-icons/fi" | ||
| import AccordionList from "@/components/accordion-list" | ||
| import { LOREM_GUIDES } from "@/components/guides/constants" | ||
|
|
||
| export function GeneralGuides() { | ||
| return ( | ||
| <main className="mx-auto flex min-h-svh w-full min-w-0 max-w-7xl flex-col gap-8 px-6 py-52 md:gap-0"> | ||
| <header className="relative flex flex-col items-center gap-1 md:static md:flex-row md:items-center md:gap-4"> | ||
| <Link | ||
| href="/guides" | ||
| replace | ||
| aria-label="Indietro" | ||
| className="absolute top-0 left-0 grid size-10 shrink-0 place-items-center rounded-full bg-white/60 md:static" | ||
| > | ||
| <FiArrowLeft className="size-5" /> | ||
| </Link> | ||
| <div className="flex min-w-0 flex-col items-center gap-1 text-center md:flex-1"> | ||
| <h1 className="typo-title-large md:typo-display-medium text-text-primary">Guide Generali</h1> | ||
| </div> | ||
| <Link | ||
| href="/guides" | ||
| aria-label="Chiudi" | ||
| className="absolute top-0 right-0 grid size-10 shrink-0 place-items-center rounded-full bg-white/60 md:static" | ||
| > | ||
| <FiX className="size-5" /> | ||
| </Link> | ||
| </header> | ||
|
|
||
| {LOREM_GUIDES.length > 0 ? ( | ||
| <AccordionList items={LOREM_GUIDES} className="md:mt-25.75" /> | ||
|
BIA3IA marked this conversation as resolved.
|
||
| ) : ( | ||
| <p className="typo-body-medium text-center text-text-secondary md:mt-16.25"> | ||
| Nessuna guida disponibile al momento. | ||
| </p> | ||
| )} | ||
| </main> | ||
| ) | ||
| } | ||
Oops, something went wrong.
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.