-
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.
π λͺ¨λ°μΌ λ΄λΉ λμμΈ λ°μ (#172)
* fix: λλ½λ suneditor-contents μ£Όμ μΆκ° * refactor: μμν λ·°μ΄λ€μ suspense μ μ© * feat: PostFallback ꡬν * fix: NewsRow λ°μν μμ μ²λ¦¬' * feat: layout.tsx μμ * design: λͺ¨λ°μΌ λ€λΉ λμμΈ μ μ© * fix: body full-width, κ²μ νλ©΄μμ λ€λΉλ°κ° μ νμμ * fix: layoutμ΄ νλ©΄μ μ±μ°λλ‘ μμ * feat: κ²μ κ²°κ³Ό suspense μ μ© * refactor: κ²μ κ²°κ³Ό μΉμ λ³λ‘ μ»΄ν¬λνΈν * feat: AdmissionSection ꡬν * fix: layoutμ΄ κ°λ₯ν μλμ° νμ λ§λλ‘ μμ * refactor: PR μ 리ν©ν°λ§
- Loading branch information
Showing
37 changed files
with
818 additions
and
553 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/useResponsive | ||
- design/mobileNav | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// TODO: searchParamsλ₯Ό μ¬μ©νμμλ static renderingμ΄ λλ κ² κ°μ μΆκ° | ||
export const dynamic = 'force-dynamic'; | ||
|
||
import { getNewsDetail } from '@/apis/news'; | ||
|
||
import Attachments from '@/components/common/Attachments'; | ||
import { StraightNode } from '@/components/common/Nodes'; | ||
import Tags from '@/components/common/Tags'; | ||
import HTMLViewer from '@/components/editor/HTMLViewer'; | ||
import { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout'; | ||
import PostFooter from '@/components/post/PostFooter'; | ||
|
||
import { PostSearchQueryParams } from '@/types/post'; | ||
|
||
import { formatNewsPostDateStr } from '@/utils/date'; | ||
import { getPath } from '@/utils/page'; | ||
import { news } from '@/utils/segmentNode'; | ||
|
||
interface NewsPostPageProps { | ||
id: number; | ||
searchParams: PostSearchQueryParams; | ||
} | ||
|
||
const newsPath = getPath(news); | ||
|
||
export default async function NewsViewer({ id, searchParams }: NewsPostPageProps) { | ||
const news = await getNewsDetail(id, searchParams); | ||
|
||
return ( | ||
<> | ||
<h2 className="px-5 py-9 text-[1.25rem] font-semibold sm:pl-[100px] sm:pr-[340px]"> | ||
{news.title} | ||
</h2> | ||
|
||
<div | ||
className="bg-neutral-50 px-5 pt-9 sm:pl-[100px] sm:pr-[340px]" | ||
style={{ paddingBottom: PAGE_PADDING_BOTTOM_PX }} | ||
> | ||
<Attachments files={news.attachments} /> | ||
<HTMLViewer htmlContent={news.description} className="mb-10" /> | ||
<time className="mb-3 mt-12 block text-end text-sm font-bold"> | ||
{formatNewsPostDateStr(news.date)} | ||
</time> | ||
<StraightNode /> | ||
<Tags tags={news.tags} margin="mt-3 ml-6" searchPath={newsPath} /> | ||
<PostFooter post={news} postType="news" id={id.toString()} margin="mt-12" /> | ||
</div> | ||
</> | ||
); | ||
} |
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,50 +1,23 @@ | ||
// TODO: searchParamsλ₯Ό μ¬μ©νμμλ static renderingμ΄ λλ κ² κ°μ μΆκ° | ||
export const dynamic = 'force-dynamic'; | ||
import { Suspense } from 'react'; | ||
|
||
import { getNewsDetail } from '@/apis/news'; | ||
|
||
import Attachments from '@/components/common/Attachments'; | ||
import { StraightNode } from '@/components/common/Nodes'; | ||
import Tags from '@/components/common/Tags'; | ||
import HTMLViewer from '@/components/editor/HTMLViewer'; | ||
import PageLayout, { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout'; | ||
import PostFooter from '@/components/post/PostFooter'; | ||
import PostFallback from '@/components/layout/fallback/PostFallback'; | ||
import PageLayout from '@/components/layout/pageLayout/PageLayout'; | ||
|
||
import { PostSearchQueryParams } from '@/types/post'; | ||
|
||
import { formatNewsPostDateStr } from '@/utils/date'; | ||
import { getPath } from '@/utils/page'; | ||
import { news } from '@/utils/segmentNode'; | ||
import NewsViewer from './NewsViewer'; | ||
|
||
interface NewsPostPageProps { | ||
params: { id: string }; | ||
searchParams: PostSearchQueryParams; | ||
} | ||
|
||
const newsPath = getPath(news); | ||
|
||
export default async function NewsPostPage({ params, searchParams }: NewsPostPageProps) { | ||
const news = await getNewsDetail(parseInt(params.id), searchParams); | ||
|
||
return ( | ||
<PageLayout titleType="big" bodyStyle={{ padding: 0 }}> | ||
<h2 className="px-5 py-9 text-[1.25rem] font-semibold sm:pl-[100px] sm:pr-[340px]"> | ||
{news.title} | ||
</h2> | ||
|
||
<div | ||
className="bg-neutral-50 px-5 pt-9 sm:pl-[100px] sm:pr-[340px]" | ||
style={{ paddingBottom: PAGE_PADDING_BOTTOM_PX }} | ||
> | ||
<Attachments files={news.attachments} /> | ||
<HTMLViewer htmlContent={news.description} className="mb-10" /> | ||
<time className="mb-3 mt-12 block text-end text-sm font-bold"> | ||
{formatNewsPostDateStr(news.date)} | ||
</time> | ||
<StraightNode /> | ||
<Tags tags={news.tags} margin="mt-3 ml-6" searchPath={newsPath} /> | ||
<PostFooter post={news} postType="news" id={params.id} margin="mt-12" /> | ||
</div> | ||
<Suspense fallback={<PostFallback />}> | ||
<NewsViewer id={parseInt(params.id)} searchParams={searchParams} /> | ||
</Suspense> | ||
</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
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,63 @@ | ||
import { getNoticePostDetail } from '@/apis/notice'; | ||
|
||
import Attachments from '@/components/common/Attachments'; | ||
import { StraightNode } from '@/components/common/Nodes'; | ||
import Tags from '@/components/common/Tags'; | ||
import HTMLViewer from '@/components/editor/HTMLViewer'; | ||
import { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout'; | ||
import PostFooter from '@/components/post/PostFooter'; | ||
|
||
import { PostSearchQueryParams } from '@/types/post'; | ||
|
||
import { formatPostDateStr } from '@/utils/date'; | ||
import { getPath } from '@/utils/page'; | ||
import { notice } from '@/utils/segmentNode'; | ||
|
||
interface NoticePostPageProps { | ||
id: number; | ||
searchParams: PostSearchQueryParams; | ||
} | ||
|
||
const noticePath = getPath(notice); | ||
|
||
export default async function NoticeViewer({ id, searchParams }: NoticePostPageProps) { | ||
const notice = await getNoticePostDetail(id, searchParams); | ||
|
||
return ( | ||
<> | ||
<Header {...notice} /> | ||
<div | ||
className="bg-neutral-50 px-5 pt-9 sm:pl-[100px] sm:pr-[340px]" | ||
style={{ | ||
paddingBottom: PAGE_PADDING_BOTTOM_PX, | ||
}} | ||
> | ||
<Attachments files={notice.attachments} /> | ||
<HTMLViewer htmlContent={notice.description} className="mb-10" /> | ||
<StraightNode /> | ||
<Tags tags={notice.tags} margin="mt-3 ml-6" searchPath={noticePath} /> | ||
<PostFooter post={notice} postType="notice" id={id.toString()} margin="mt-12" /> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
const Header = ({ | ||
title, | ||
author, | ||
createdAt, | ||
}: { | ||
title: string; | ||
author: string; | ||
createdAt: string; | ||
}) => { | ||
return ( | ||
<div className="flex flex-col gap-4 px-5 py-9 sm:pl-[100px] sm:pr-[340px]"> | ||
<h2 className="text-[1.25rem] font-semibold">{title}</h2> | ||
<div className="flex gap-5 text-sm font-normal tracking-wide text-neutral-500"> | ||
<p>κΈμ΄μ΄: {author}</p> | ||
<p>μμ± μκ°: {formatPostDateStr(createdAt)}</p> | ||
</div> | ||
</div> | ||
); | ||
}; |
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
Oops, something went wrong.