Skip to content

Commit

Permalink
update notices table
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Dec 10, 2023
1 parent 584e30f commit d220b67
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
33 changes: 19 additions & 14 deletions components/board/notice/notice.table.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Link from 'next/link'
import moment from 'moment'
import { Image, Table } from 'semantic-ui-react'
import { Table } from 'semantic-ui-react'

const NoticeTable
= ({notices}) => {
Expand All @@ -11,12 +11,12 @@ const NoticeTable
>
<Table.Header>
<Table.Row>
<Table.HeaderCell>id.</Table.HeaderCell>
<Table.HeaderCell>제목</Table.HeaderCell>
<Table.HeaderCell>내용</Table.HeaderCell>
<Table.HeaderCell>이미지</Table.HeaderCell>
<Table.HeaderCell>게시 일자</Table.HeaderCell>
<Table.HeaderCell>클릭수</Table.HeaderCell>
<Table.HeaderCell width={1}>id.</Table.HeaderCell>
<Table.HeaderCell width={4}>제목</Table.HeaderCell>
<Table.HeaderCell width={6}>내용</Table.HeaderCell>
{/* <Table.HeaderCell>이미지</Table.HeaderCell> */}
<Table.HeaderCell width={5}>게시 일자</Table.HeaderCell>
<Table.HeaderCell width={1}>클릭수</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
Expand All @@ -28,18 +28,23 @@ const NoticeTable
<Table.Row key={notice.id}>
<Table.Cell>{idx + 1}</Table.Cell>
<Table.Cell>
<a href={notice.link} target={'_blank'} rel={"noreferrer"}>
{notice.title}
</a>
{
notice.link ? (
<a href={notice.link} target={'_blank'} rel={"noreferrer"}>
{notice.title}
</a>
) : notice.title
}
</Table.Cell>
<Table.Cell>
<Table.Cell style={{whiteSpace: "pre-line", textAlign: "left"}}>
{notice.content}
</Table.Cell>
<Table.Cell>
{/* <Table.Cell>
<Image href={notice.link}/>
</Table.Cell>
</Table.Cell> */}
<Table.Cell>
{moment(notice.start_datetime).format('YYYY-MM-DD HH:mm')} ~ {moment(notice.end_datetime).format('YYYY-MM-DD HH:mm')} ({Number(duration/24).toFixed(0)}{duration%24}시간)
{moment(notice.start_datetime).format('YYYY-MM-DD HH:mm')} ~ {moment(notice.end_datetime).format('YYYY-MM-DD HH:mm')}<br/>
({Number(duration/24).toFixed(0)}{duration%24}시간)
</Table.Cell>
<Table.Cell>
{notice.click_count}
Expand Down
5 changes: 4 additions & 1 deletion pages/board/notice/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const AnnouncementPage = ({ noticeList }) => {

<Message>
공지사항은 빠른 게시 시작 일자로 정렬되어 표시됩니다!
이미지가 업로드 되지 않은 공지는 생성되어도 게시되지 않습니다.
</Message>

<Message warning>
기능 개발이 계속 이뤄지고 있습니다.
</Message>

<div>
Expand Down

0 comments on commit d220b67

Please sign in to comment.