Skip to content

Commit

Permalink
fix mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Dec 10, 2023
1 parent 814b198 commit d76b27f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 29 deletions.
53 changes: 27 additions & 26 deletions components/board/notice/notice.table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { Image, Table } from 'semantic-ui-react'

const NoticeTable
= ({notices}) => {
const duration = moment(end_datetime).diff(moment(start_datetime), 'hours');

return (
<Table
celled selectable
Expand All @@ -23,30 +21,33 @@ const NoticeTable
</Table.Header>
<Table.Body>
{
notices.map((notice, idx) =>
<Link href={`benefit/notice/update/${notice.id}`} key={notice.id}>
<Table.Row key={notice.id}>
<Table.Cell>{idx + 1}</Table.Cell>
<Table.Cell>
<a href={notice.link} target={'_blank'} rel={"noreferrer"}>
{notice.title}
</a>
</Table.Cell>
<Table.Cell>
{notice.content}
</Table.Cell>
<Table.Cell>
<Image href={notice.link}/>
</Table.Cell>
<Table.Cell>
{notice.start_datetime} ~ {notice.end_datetime} ({Number(duration/24).toFixed(0)}{duration%24}시간)
</Table.Cell>
<Table.Cell>
{notice.click_count}
</Table.Cell>
</Table.Row>
</Link>
)
notices.map((notice, idx) => {
const duration = moment(notice.end_datetime).diff(moment(notice.start_datetime), 'hours');
return (
<Link href={`/board/notice/update/${notice.id}`} key={notice.id}>
<Table.Row key={notice.id}>
<Table.Cell>{idx + 1}</Table.Cell>
<Table.Cell>
<a href={notice.link} target={'_blank'} rel={"noreferrer"}>
{notice.title}
</a>
</Table.Cell>
<Table.Cell>
{notice.content}
</Table.Cell>
<Table.Cell>
<Image href={notice.link}/>
</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}시간)
</Table.Cell>
<Table.Cell>
{notice.click_count}
</Table.Cell>
</Table.Row>
</Link>
)
})
}
</Table.Body>
</Table>
Expand Down
7 changes: 4 additions & 3 deletions pages/board/notice/update/[id].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const NoticeUpdatePage = ({ noticeInfo }) => {

const [deleteModalOpen, setDeleteModalOpen] = useState(false)

const id = noticeInfo.id;
const [title, setTitle] = useState(noticeInfo.title)
const [content, setContent] = useState(noticeInfo.content)
const [link, setLink] = useState(noticeInfo.link)
Expand Down Expand Up @@ -62,7 +63,7 @@ const NoticeUpdatePage = ({ noticeInfo }) => {
/>

<Message>
공지사항은 이미지 업로드는 공지사항 생성 후, 수정 페이지에서 가능합니다.
공지사항 이미지 업로드는 공지사항 생성 후, 수정 페이지에서 가능합니다.
</Message>

<Form.TextArea
Expand All @@ -84,8 +85,8 @@ const NoticeUpdatePage = ({ noticeInfo }) => {

<ImageUploadForm
type={'공지사항'}
uploadApiUri={`notice/image/${notice.id}`}
originalImageUrl={notice.image_url}
uploadApiUri={`notice/image/${id}`}
originalImageUrl={noticeInfo.image_url}
/>
<Message>
권장 이미지 사이즈(가로 x 세로): 540 x 200
Expand Down

0 comments on commit d76b27f

Please sign in to comment.