Skip to content

Commit

Permalink
๐Ÿ“ฑ ์†Œ์‹ํƒญ ๋ณธ๋ฌธ ๋ชจ๋ฐ”์ผ ๋ฐ˜์‘ํ˜• ์ถ”๊ฐ€ (#153)
Browse files Browse the repository at this point in the history
* fix: ๊ณต์ง€ ์„ธ๋ถ€ ํŽ˜์ด์ง€ ๋ฐ˜์‘ํ˜• ์ถ”๊ฐ€

* fix: ์ฒจ๋ถ€ํŒŒ์ผ ๋ฐ˜์‘ํ˜• ์ถ”๊ฐ€

* fix: ์ƒˆ์†Œ์‹ ์ƒ์„ธ ํŽ˜์ด์ง€ ๋ฐ˜์‘ํ˜• ์ถ”๊ฐ€

* fix: ์„ธ๋ฏธ๋‚˜ ํŽ˜์ด์ง€ ๋ชจ๋ฐ”์ผ ๋ฐ˜์‘ํ˜• ์ถ”๊ฐ€
  • Loading branch information
Limchansol authored Mar 9, 2024
1 parent d6efbec commit 2446aec
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 95 deletions.
47 changes: 25 additions & 22 deletions app/[locale]/community/news/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 from '@/components/layout/pageLayout/PageLayout';
import PageLayout, { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout';

import { PostSearchQueryParams } from '@/types/post';

Expand All @@ -29,27 +29,30 @@ export default async function NewsPostPage({ params, searchParams }: NewsPostPag
}์›” ${date.getDate()}์ผ ${date.toLocaleString('ko-KR', { weekday: 'long' })}`;

return (
<PageLayout title={currPost.title} titleType="small" titleMargin="mb-5">
{currPost.attachments.length !== 0 && <Attachments files={currPost.attachments} />}
<HTMLViewer
htmlContent={currPost.description}
className="mt-4"
topRightContent={
currPost.imageURL
? { type: 'imageUnoptimized', url: currPost.imageURL, width: 320 }
: undefined
}
/>
<time className=" mt-12 block text-end text-sm font-bold">{dateStr}</time>
<StraightNode margin="mt-[2.4375rem]" />
<Tags tags={currPost.tags} margin="mt-3 ml-6" searchPath={newsPath} />
<AdjPostNav
prevPost={prevPostPreview}
nextPost={nextPostPreview}
postType="news"
id={params.id}
margin="mt-12"
/>
<PageLayout titleType="big" bodyStyle={{ padding: 0 }}>
<h2 className="px-5 py-9 text-[1.25rem] font-semibold sm:pl-[100px] sm:pr-[340px]">
{currPost.title}
</h2>

<div
className="bg-neutral-50 px-5 pt-9 sm:pl-[100px] sm:pr-[340px]"
style={{
paddingBottom: PAGE_PADDING_BOTTOM_PX,
}}
>
{currPost.attachments.length !== 0 && <Attachments files={currPost.attachments} />}
<HTMLViewer htmlContent={currPost?.description || ''} className="mb-10" />
<time className="mb-3 mt-12 block text-end text-sm font-bold">{dateStr}</time>
<StraightNode />
<Tags tags={currPost?.tags || []} margin="mt-3 ml-6" searchPath={newsPath} />
<AdjPostNav
prevPost={prevPostPreview}
nextPost={nextPostPreview}
postType="notice"
id={params.id}
margin="mt-12"
/>
</div>
</PageLayout>
);
}
22 changes: 6 additions & 16 deletions app/[locale]/community/notice/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ 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,
PAGE_PADDING_LEFT_PX,
PAGE_PADDING_RIGHT_PX,
PAGE_PADDING_TOP_PX,
} from '@/components/layout/pageLayout/PageLayout';
import PageLayout, { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout';

import { PostSearchQueryParams } from '@/types/post';

Expand All @@ -35,7 +30,7 @@ export default async function NoticePostPage({
return (
<PageLayout titleType="small" titleMargin="mb-5">
<p>
<b>{`'${rawId}'`}</b>๋Š” ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š์€ id์ž…๋‹ˆ๋‹ค.
<b>{rawId}</b>๋Š” ์˜ฌ๋ฐ”๋ฅด์ง€ ์•Š์€ id์ž…๋‹ˆ๋‹ค.
</p>
<AdjPostNav postType="notice" margin="mt-12" />
</PageLayout>
Expand All @@ -46,18 +41,16 @@ export default async function NoticePostPage({
const { prevPostPreview, nextPostPreview } = getAdjPostsInfo(currPost, searchParams, noticePath);

return (
<PageLayout titleType="big" titleMargin="mb-5" bodyStyle={{ padding: 0 }}>
<PageLayout titleType="big" bodyStyle={{ padding: 0 }}>
<Header title={currPost.title} author={currPost.author} dateStr={currPost.createdAt} />
<div
className="bg-neutral-50 pt-9"
className="bg-neutral-50 px-5 pt-9 sm:pl-[100px] sm:pr-[340px]"
style={{
paddingLeft: PAGE_PADDING_LEFT_PX,
paddingRight: PAGE_PADDING_RIGHT_PX,
paddingBottom: PAGE_PADDING_BOTTOM_PX,
}}
>
{currPost.attachments.length !== 0 && <Attachments files={currPost.attachments} />}
<HTMLViewer htmlContent={currPost?.description || ''} className="mb-10 mt-4" />
<HTMLViewer htmlContent={currPost?.description || ''} className="mb-10" />
<StraightNode />
<Tags tags={currPost?.tags || []} margin="mt-3 ml-6" searchPath={noticePath} />
<AdjPostNav
Expand All @@ -74,10 +67,7 @@ export default async function NoticePostPage({

function Header({ title, author, dateStr }: { title: string; author: string; dateStr: string }) {
return (
<div
className="mb-9 flex flex-col gap-4"
style={{ paddingTop: PAGE_PADDING_TOP_PX, paddingLeft: PAGE_PADDING_LEFT_PX }}
>
<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>
Expand Down
85 changes: 45 additions & 40 deletions app/[locale]/community/seminar/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Attachments from '@/components/common/Attachments';
import ImageWithFallback from '@/components/common/ImageWithFallback';
import { StraightNode } from '@/components/common/Nodes';
import HTMLViewer from '@/components/editor/HTMLViewer';
import PageLayout from '@/components/layout/pageLayout/PageLayout';
import PageLayout, { PAGE_PADDING_BOTTOM_PX } from '@/components/layout/pageLayout/PageLayout';

import { PostSearchQueryParams } from '@/types/post';

Expand All @@ -31,60 +31,65 @@ export default async function SeminarPostPage({ params, searchParams }: SeminarP
const { prevPostPreview, nextPostPreview } = getAdjPostsInfo(currPost, searchParams, seminarPath);

return (
<PageLayout title={currPost.title} titleType="small" titleMargin="mb-5">
<div className="mb-9 flow-root break-all text-sm leading-[1.63rem] text-neutral-700">
<PageLayout titleType="big" bodyStyle={{ padding: 0 }}>
<h2 className="px-5 py-9 text-[1.25rem] font-semibold sm:pl-[100px] sm:pr-[340px]">
{currPost.title}
</h2>
<div
className="bg-neutral-50 px-5 pt-9 sm:pl-[100px] sm:pr-[340px]"
style={{
paddingBottom: PAGE_PADDING_BOTTOM_PX,
}}
>
{currPost.attachments.length !== 0 && <Attachments files={currPost.attachments} />}

<div className="relative float-right mb-7 ml-7 mt-4 h-60 w-60">
<ImageWithFallback
src={currPost.imageURL ?? undefined}
alt="๋Œ€ํ‘œ ์ด๋ฏธ์ง€"
fill
className="flex-1 object-cover"
sizes="240px"
/>
</div>

<div>
{'์ด๋ฆ„: '}
<LinkOrText href={currPost.speakerURL}>{currPost.name}</LinkOrText>
</div>

<div>{currPost.speakerTitle && <p>์งํ•จ: {currPost.speakerTitle}</p>}</div>
<div>
{'์†Œ์†: '}
<LinkOrText href={currPost.affiliationURL}>{currPost.affiliation}</LinkOrText>
<div className="mb-9 flex flex-col-reverse justify-between gap-5 text-md leading-loose sm:flex-row">
<div className="whitespace-nowrap">
<div>
{'์ด๋ฆ„: '}
<LinkOrText href={currPost.speakerURL}>{currPost.name}</LinkOrText>
</div>
<div>{currPost.speakerTitle && <p>์งํ•จ: {currPost.speakerTitle}</p>}</div>
<div>
{'์†Œ์†: '}
<LinkOrText href={currPost.affiliationURL}>{currPost.affiliation}</LinkOrText>
</div>
<div className="mt-10">์ฃผ์ตœ: {currPost.host}</div>
<div>์ผ์‹œ: {formatStartEndDate(currPost.startDate, currPost.endDate)}</div>
<div>์žฅ์†Œ: {currPost.location}</div>
</div>
<div className="relative mx-7 aspect-square sm:h-60 sm:w-60">
<ImageWithFallback
alt={`๋Œ€ํ‘œ_์ด๋ฏธ์ง€`}
src={currPost.imageURL}
className="object-contain"
fill
/>
</div>
</div>

<div className="mt-10">์ฃผ์ตœ: {currPost.host}</div>

<div>์ผ์‹œ: {formatStartEndDate(currPost.startDate, currPost.endDate)}</div>

<div>์žฅ์†Œ: {currPost.location}</div>

{currPost.description && (
<>
<div className="mt-12 font-bold">์š”์•ฝ</div>
<div className="mt-10 font-bold">์š”์•ฝ</div>
<HTMLViewer htmlContent={currPost.description} />
</>
)}

{currPost.introduction && (
<>
<div className="mt-12 font-bold">์—ฐ์‚ฌ ์†Œ๊ฐœ</div>
<div className="mt-10 font-bold">์—ฐ์‚ฌ ์†Œ๊ฐœ</div>
<HTMLViewer htmlContent={currPost.introduction} />
</>
)}
</div>

<StraightNode />
<AdjPostNav
prevPost={prevPostPreview}
nextPost={nextPostPreview}
postType="seminar"
id={params.id}
margin="mt-12"
/>
<StraightNode margin="mt-10" />
<AdjPostNav
prevPost={prevPostPreview}
nextPost={nextPostPreview}
postType="notice"
id={params.id}
margin="mt-12"
/>
</div>
</PageLayout>
);
}
Expand Down
7 changes: 4 additions & 3 deletions components/common/Attachments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function Attachments({ files }: { files: Attachment[] }) {
if (files.length === 0) return <></>;

return (
<div className="relative mb-6 mt-5 flex w-[40rem] flex-col gap-2 rounded-sm border border-neutral-300 bg-white px-4 py-3">
<div className="relative mb-6 mt-5 flex flex-col gap-2 rounded-sm border border-neutral-300 bg-white px-4 py-3">
{files.map((file, index) => (
<AttachmentAnchor key={index} {...file} />
))}
Expand All @@ -23,12 +23,13 @@ const AttachmentAnchor = ({ name, bytes, url }: Attachment) => {
const kilobyte = Math.round(bytes / 100);
return (
<a
className="w-fit text-sm font-normal hover:underline"
className="flex text-sm font-normal hover:underline"
href={url}
download={name}
target="_blank"
>
{name}({kilobyte / 10}KB)
<span className="overflow-hidden text-ellipsis whitespace-nowrap">{name}</span>
<span>({kilobyte / 10}KB)</span>
</a>
);
};
2 changes: 1 addition & 1 deletion components/common/selection/SelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function SelectionList({
const gridStyle = `grid-cols-[repeat(2,_1fr)] ${listGridColumnClass}`;

return (
<ul className={`grid ${gridStyle} mb-6 gap-3 pt-7 sm:mb-9 sm:pt-[44px]`}>
<ul className={`grid ${gridStyle} mb-6 gap-3 pt-7 sm:mb-9 sm:pt-11`}>
{names.map((name) => (
<SelectionItem
key={name}
Expand Down
13 changes: 0 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2446aec

Please sign in to comment.