-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: 학부 안내, 교과 과정, 전공 이수 표준 형태 * refactor: undergraduate/general-studies-requirement 리팩터링 * refactor: 학부 졸업 규정 SSR로 수정 * refactor: 학부 교과목 변경 내역 리팩터링 * refactor: 교과목 변경 내역 SSR로 수정 * refactor: 장학 제도 SSR로 리팩터링 * fix: 장학금 상세 페이지 force-static
- Loading branch information
Showing
36 changed files
with
291 additions
and
352 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
- refactor/research | ||
- refactor/academics | ||
|
||
jobs: | ||
build: | ||
|
This file contains 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 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 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 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 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,27 +1,9 @@ | ||
export const dynamic = 'force-static'; | ||
|
||
import { getMockGraduateScholarshipList } from '@/data/serverObjects'; | ||
|
||
import { ScholarshipRow } from '@/components/academics/ScholarshipRow'; | ||
import HTMLViewer from '@/components/editor/HTMLViewer'; | ||
import PageLayout from '@/components/layout/pageLayout/PageLayout'; | ||
import ScholarshipPreview from '../../helper/ScholarshipPreview'; | ||
|
||
export default async function GraduateScholarshipListPage() { | ||
const { description, scholarship } = await getMockGraduateScholarshipList(); | ||
const data = await getMockGraduateScholarshipList(); | ||
|
||
return ( | ||
<PageLayout titleType="big"> | ||
<HTMLViewer htmlContent={description} className="mt-7" /> | ||
<div className=" mt-10 flex flex-col"> | ||
<h3 className="border-b-[1px] border-b-neutral-200 pb-2 text-[20px] font-bold leading-10"> | ||
장학금 종류 | ||
</h3> | ||
<ul className="mt-2"> | ||
{scholarship.map((item) => ( | ||
<ScholarshipRow id={item.id} name={item.name} key={item.id} type="GRADUATE" /> | ||
))} | ||
</ul> | ||
</div> | ||
</PageLayout> | ||
); | ||
return <ScholarshipPreview description={data.description} scholarshipList={data.scholarship} />; | ||
} |
This file contains 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,42 @@ | ||
'use client'; | ||
|
||
import { useState } from 'react'; | ||
|
||
import TimeLine from '@/app/[locale]/academics/helper/TimeLine'; | ||
|
||
import HTMLViewer from '@/components/editor/HTMLViewer'; | ||
import PageLayout from '@/components/layout/pageLayout/PageLayout'; | ||
|
||
import { CourseChange } from '@/types/academics'; | ||
|
||
export type TimeSpots = { year: number; margin?: string; isLast?: boolean }[]; | ||
|
||
type CourseChangesProps = { | ||
changes: CourseChange[]; | ||
yearLimit: number; | ||
timeSpots: TimeSpots; | ||
}; | ||
|
||
// TODO: 연도 추가되어도 타임라인 잘 설정되도록 리팩토링 | ||
export default function CourseChanges({ changes, yearLimit, timeSpots }: CourseChangesProps) { | ||
const [year, setYear] = useState(2020); | ||
const selectedChanges = getSelectedChanges(year, yearLimit, changes); | ||
|
||
return ( | ||
<PageLayout titleType="big"> | ||
<TimeLine timeSpots={timeSpots} selectedYear={year} setSelectedYear={setYear} /> | ||
{selectedChanges.map((change) => ( | ||
<HTMLViewer htmlContent={change.description} className="mt-12" key={change.year} /> | ||
))} | ||
</PageLayout> | ||
); | ||
} | ||
|
||
const getSelectedChanges = (year: number, yearLimit: number, data: CourseChange[]) => { | ||
if (year <= yearLimit) return data.filter((d) => d.year <= yearLimit); | ||
|
||
const change = data.find((d) => d.year === year); | ||
return change | ||
? [change] | ||
: [{ year, description: `${year}학년도 교과과정 변경 내역은 없습니다.` }]; | ||
}; |
File renamed without changes.
File renamed without changes.
This file contains 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,20 @@ | ||
import HTMLViewer from '@/components/editor/HTMLViewer'; | ||
import PageLayout from '@/components/layout/pageLayout/PageLayout'; | ||
|
||
import { Scholarship } from '@/types/academics'; | ||
|
||
export default async function ScholarshipDetail({ | ||
scholarship: { name, description }, | ||
}: { | ||
scholarship: Scholarship; | ||
}) { | ||
// 타이틀이 긴 경우 정규표현식으로 괄호 내부 내용을 제거 | ||
// ex) 교외장학금 (현송문화재단, 유한재단, ...) -> 교외장학금 | ||
const shortTitle = name.length > 20 ? name.replace(/\([^)]*\)/g, '') : name; | ||
|
||
return ( | ||
<PageLayout title={shortTitle} titleType="big" titleMargin="mb-8"> | ||
<HTMLViewer htmlContent={description} /> | ||
</PageLayout> | ||
); | ||
} |
This file contains 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,58 @@ | ||
import Link from 'next/link'; | ||
|
||
import HTMLViewer from '@/components/editor/HTMLViewer'; | ||
import PageLayout from '@/components/layout/pageLayout/PageLayout'; | ||
|
||
import { getPath } from '@/utils/page'; | ||
import { undergraduateScholarship, graduateScholarship } from '@/utils/segmentNode'; | ||
|
||
const undergraduateScholarshipPath = getPath(undergraduateScholarship); | ||
const graduateScholarshipPath = getPath(graduateScholarship); | ||
|
||
export default async function ScholarshipPreview({ | ||
description, | ||
scholarshipList, | ||
}: { | ||
description: string; | ||
scholarshipList: { id: number; name: string }[]; | ||
}) { | ||
return ( | ||
<PageLayout titleType="big"> | ||
<HTMLViewer htmlContent={description} className="mt-7" /> | ||
<div className=" mt-10 flex flex-col"> | ||
<h3 className="border-b-[1px] border-b-neutral-200 pb-2 text-[20px] font-bold leading-10"> | ||
장학금 종류 | ||
</h3> | ||
<ul className="mt-2"> | ||
{scholarshipList.map((item) => ( | ||
<ScholarshipRow id={item.id} name={item.name} key={item.id} type="UNDERGRADUATE" /> | ||
))} | ||
</ul> | ||
</div> | ||
</PageLayout> | ||
); | ||
} | ||
|
||
export interface ScholarshipRowProps { | ||
id: number; | ||
name: string; | ||
type: 'GRADUATE' | 'UNDERGRADUATE'; | ||
} | ||
|
||
export function ScholarshipRow({ id, name, type }: ScholarshipRowProps) { | ||
return ( | ||
<li className="my-1 w-fit"> | ||
<Link | ||
href={`${ | ||
type === 'GRADUATE' ? graduateScholarshipPath : undergraduateScholarshipPath | ||
}/${id}`} | ||
className="group flex h-7 items-center gap-2.5 px-3" | ||
> | ||
<div className="h-2.5 w-2.5 rounded-full border border-main-orange duration-300 group-hover:bg-main-orange" /> | ||
<span className="text-sm font-medium duration-300 group-hover:text-main-orange"> | ||
{name} | ||
</span> | ||
</Link> | ||
</li> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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 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
File renamed without changes.
This file contains 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
Oops, something went wrong.