Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@
"tailwindFunctions": ["clsx", "cva"],
"trailingComma": "es5",
"tabWidth": 2,
"useTabs": false
"useTabs": false,
"overrides": [
{
"files": "*.json",
"options": {
"trailingComma": "none"
}
}
]
}
2 changes: 1 addition & 1 deletion app/[locale]/@modals/(.)profile/edit/client-utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const renderFields = <T extends Record<string, any>>(
value={
Array.isArray(field.value)
? (field.value as string[]).join(', ')
: (field.value as string) ?? ''
: ((field.value as string) ?? '')
}
onChange={(e) => {
field.onChange(e.target.value);
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/@modals/(.)search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function Page({
>
<Search
currentCategory={
category ?? '' in schema ? (category as keyof typeof schema) : 'all'
(category ?? '' in schema) ? (category as keyof typeof schema) : 'all'
}
locale={locale}
query={query}
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/academics/admission/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default async function AdmissionPage({
const hasMore = raw.length > INITIAL_BATCH_SIZE;
const initialItems = hasMore ? raw.slice(0, INITIAL_BATCH_SIZE) : raw;
const initialCursor = hasMore
? initialItems[initialItems.length - 1]?.createdAt.toISOString() ?? null
? (initialItems[initialItems.length - 1]?.createdAt.toISOString() ?? null)
: null;

// Serialize for client component
Expand Down
60 changes: 41 additions & 19 deletions app/[locale]/academics/curricula/[code]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Revalidate every 5 minutes (has DB calls)
export const revalidate = 300;

import Image from 'next/image';
import Link from 'next/link';
import { notFound } from 'next/navigation';
import { MdEmail, MdPhone } from 'react-icons/md';

import Heading from '~/components/heading';
import ImageHeader from '~/components/image-header';
Expand Down Expand Up @@ -66,9 +64,17 @@ export default async function Curriculum({
</h5>

<h5>{text.objectives}:</h5>
{course.objectives.map((objective, index) => (
<li key={index}>{objective}</li>
))}
{course.objectives.length > 1 ? (
<ul className="list-disc space-y-2 pl-5">
{course.objectives.map((objective, index) => (
<li key={index}>{objective}</li>
))}
</ul>
) : (
course.objectives.map((objective, index) => (
<p key={index}>{objective}</p>
))
)}

<h5 className="mb-2 flex">
{text.similarCourses}:
Expand Down Expand Up @@ -98,13 +104,19 @@ export default async function Curriculum({
<AccordionItem key={index} value={section.title}>
<AccordionTrigger>{section.title}</AccordionTrigger>
<AccordionContent>
<ol className="list-decimal space-y-2 pl-5">
{section.topics.map((topic, subIndex) => (
<li key={subIndex}>
<p>{topic}</p>
</li>
))}
</ol>
{section.topics.length > 1 ? (
<ol className="list-decimal space-y-2 pl-5">
{section.topics.map((topic, subIndex) => (
<li key={subIndex}>
<p>{topic}</p>
</li>
))}
</ol>
) : (
section.topics.map((topic, subIndex) => (
<p key={subIndex}>{topic}</p>
))
)}
</AccordionContent>
</AccordionItem>
))}
Expand Down Expand Up @@ -137,13 +149,23 @@ export default async function Curriculum({
/>

<section className="rounded-xl border border-primary-500 bg-neutral-50">
<ol className="flex list-disc flex-col space-y-4 p-12">
{course.essentialReading.map((book, index) => (
<li key={index}>
<p className="font-medium text-primary-300">{book}</p>
</li>
))}
</ol>
{course.essentialReading.length > 1 ? (
<ol className="flex list-disc flex-col space-y-4 p-12">
{course.essentialReading.map((book, index) => (
<li key={index}>
<p className="font-medium text-primary-300">{book}</p>
</li>
))}
</ol>
) : (
<div className="p-12">
{course.essentialReading.map((book, index) => (
<p key={index} className="font-medium text-primary-300">
{book}
</p>
))}
</div>
)}
</section>
</section>
</main>
Expand Down
Loading