Skip to content

Commit

Permalink
memo -> content
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Dec 10, 2023
1 parent 0dc9704 commit 52e3575
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
14 changes: 9 additions & 5 deletions components/board/notice/notice.table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Table } from 'semantic-ui-react'

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

return (
<Table
Expand All @@ -14,11 +15,10 @@ const NoticeTable
<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>클릭수</Table.HeaderCell>
<Table.HeaderCell></Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
Expand All @@ -32,10 +32,14 @@ const NoticeTable
{notice.title}
</a>
</Table.Cell>
<Table.Cell>{notice.content}</Table.Cell>
<Table.Cell>
{moment(notice.created_at).
format('YYYY-MM-DD HH:mm')}
{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}
Expand Down
10 changes: 5 additions & 5 deletions pages/board/notice/create.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const NoticeCreatePage = () => {
const router = useRouter();

const [title, setTitle] = useState('')
const [memo, setMemo] = useState()
const [content, setContent] = useState()
const [link, setLink] = useState()
const [start_datetime, setStartDatetime] = useState()
const [end_datetime, setEndDatetime] = useState()
Expand All @@ -22,7 +22,7 @@ const NoticeCreatePage = () => {
const handleSubmit = async () => {
const body = {
'title': title,
'memo': memo,
'content': content,
'link': link,
'start_datetime': start_datetime,
'end_datetime': end_datetime,
Expand Down Expand Up @@ -62,13 +62,13 @@ const NoticeCreatePage = () => {
/>

<Message warning>
공지사항은 이미지가 업로드 되어야 게시됩니다. 이미지 업로드는 공지사항 생성 후, 등록 할 수 있습니다.
공지사항 이미지 업로드는 공지사항 생성 후, 등록 할 수 있습니다.
</Message>

<Form.TextArea
required
label={'메모'}
onChange={e => setMemo(e.target.value)}
label={'내용'}
onChange={e => setContent(e.target.value)}
/>

<Form.Input
Expand Down
12 changes: 6 additions & 6 deletions pages/board/notice/update/[id].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const NoticeUpdatePage = ({ noticeInfo }) => {
const [deleteModalOpen, setDeleteModalOpen] = useState(false)

const [title, setTitle] = useState(noticeInfo.title)
const [memo, setMemo] = useState(noticeInfo.memo)
const [content, setContent] = useState(noticeInfo.content)
const [link, setLink] = useState(noticeInfo.link)
const [start_datetime, setStartDatetime] = useState(noticeInfo.start_datetime)
const [end_datetime, setEndDatetime] = useState(noticeInfo.end_datetime)
Expand All @@ -25,7 +25,7 @@ const NoticeUpdatePage = ({ noticeInfo }) => {
const handleSubmit = async () => {
const body = {
'title': title,
'memo': memo,
'content': content,
'link': link,
'start_datetime': start_datetime,
'end_datetime': end_datetime,
Expand Down Expand Up @@ -61,14 +61,14 @@ const NoticeUpdatePage = ({ noticeInfo }) => {
/>

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

<Form.TextArea
required
label={'메모'}
value={memo}
onChange={e => setMemo(e.target.value)}
label={'내용'}
value={content}
onChange={e => setContent(e.target.value)}
/>

<Form.Input
Expand Down

0 comments on commit 52e3575

Please sign in to comment.