Skip to content

Commit

Permalink
Benefits CRUD (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 authored Oct 29, 2023
1 parent 6f702f1 commit 829fdad
Show file tree
Hide file tree
Showing 11 changed files with 540 additions and 276 deletions.
241 changes: 0 additions & 241 deletions assets/affiliate.data.js

This file was deleted.

54 changes: 54 additions & 0 deletions components/board/benefit/affiliate/affiliate.table.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from 'react'
import Link from "next/link";
import moment from 'moment'
import { Table } from 'semantic-ui-react'

const AffiliateTable = ({ affiliateList }) => {

return (
<Table
celled selectable
textAlign={'center'}>
<Table.Header>
<Table.Row>
<Table.HeaderCell width={1}>
id
</Table.HeaderCell>
<Table.HeaderCell width={2}>
업체명
</Table.HeaderCell>
<Table.HeaderCell width={4}>
짤은 설명
</Table.HeaderCell>
<Table.HeaderCell width={6}>
설명
</Table.HeaderCell>
<Table.HeaderCell width={2}>
생성일
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
{
affiliateList.map((affiliate) => (
<Link href={`benefit/affiliate/update/${affiliate.id}`} key={affiliate.id}>
<Table.Row>
<Table.Cell>{affiliate.id}</Table.Cell>
<Table.Cell>{affiliate.title}</Table.Cell>
<Table.Cell>{affiliate.content_short}</Table.Cell>
<Table.Cell>{affiliate.content}</Table.Cell>
<Table.Cell>
{
moment(affiliate.created_at).format('YYYY-MM-DD HH:mm')
}
</Table.Cell>
</Table.Row>
</Link>
))
}
</Table.Body>
</Table>
)
}

export default AffiliateTable;
62 changes: 62 additions & 0 deletions components/board/benefit/discount/discount.table.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import React from 'react'
import Link from "next/link";
import moment from 'moment'
import { Table } from 'semantic-ui-react'

const DiscountTable = ({ discountList }) => {

return (
<Table
celled selectable
textAlign={'center'}>
<Table.Header>
<Table.Row>
<Table.HeaderCell width={1}>
id
</Table.HeaderCell>
<Table.HeaderCell width={2}>
업체명
</Table.HeaderCell>
<Table.HeaderCell width={1}>
지역
</Table.HeaderCell>
<Table.HeaderCell width={2}>
영업 시간
</Table.HeaderCell>
<Table.HeaderCell width={2}>
가게 번호
</Table.HeaderCell>
<Table.HeaderCell width={6}>
할인 내용
</Table.HeaderCell>
<Table.HeaderCell width={2}>
생성일
</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
{
discountList.map((discount) => (
<Link href={`benefit/discount/update/${discount.id}`} key={discount.id}>
<Table.Row>
<Table.Cell>{discount.id}</Table.Cell>
<Table.Cell>{discount.title}</Table.Cell>
<Table.Cell>{discount.region}</Table.Cell>
<Table.Cell>{discount.open_hour}</Table.Cell>
<Table.Cell>{discount.phone}</Table.Cell>
<Table.Cell>{discount.content}</Table.Cell>
<Table.Cell>
{
moment(discount.created_at).format('YYYY-MM-DD HH:mm')
}
</Table.Cell>
</Table.Row>
</Link>
))
}
</Table.Body>
</Table>
)
}

export default DiscountTable;
2 changes: 1 addition & 1 deletion components/board/board.menubar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class BoardMenubar extends Component {
</Menu.Item>
</Link>
<Menu.Item href={'/board/benefit'} passHref>
제휴 및 할인업체 소개
총학 제휴/할인 업체
</Menu.Item>
<Menu.Item disabled>
동아리 게시물
Expand Down
Loading

0 comments on commit 829fdad

Please sign in to comment.