-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
58ef6c0
commit cd7d931
Showing
21 changed files
with
1,228 additions
and
404 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export const OwnerOptions = [ | ||
{ key: "chonghak", text: "총학생회", value: "chonghak" }, | ||
{ key: "dongyeon", text: "동아리연합회", value: "dongyeon" }, | ||
{ key: "dormUnion", text: "생활관자치회", value: "dormUnion" }, | ||
{ key: "chonghak", text: "총학생회", value: "chonghak" }, | ||
{ key: "saengna", text: "생각나눔", value: "saengna" }, | ||
{ key: "others", text: "그 외", value: "others" }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import React from 'react' | ||
import { Label, Table } from 'semantic-ui-react' | ||
import moment from 'moment' | ||
import EquipmentReservationConfirmModal | ||
from './equipment.reservation.confirm.modal' | ||
|
||
const EquipmentReservationWaitTable = ({ reservations, startIdx }) => { | ||
return ( | ||
<Table | ||
celled selectable | ||
textAlign={'center'}> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.HeaderCell width={1}>idx.</Table.HeaderCell> | ||
<Table.HeaderCell width={3}>장비 목록</Table.HeaderCell> | ||
<Table.HeaderCell width={2}>사용자</Table.HeaderCell> | ||
<Table.HeaderCell>예약 제목</Table.HeaderCell> | ||
<Table.HeaderCell width={4}>예약 기간</Table.HeaderCell> | ||
<Table.HeaderCell width={2}>상태</Table.HeaderCell> | ||
</Table.Row> | ||
</Table.Header> | ||
<Table.Body> | ||
{ | ||
reservations.map((reservation, idx) => { | ||
|
||
const start_datetime = moment( | ||
`${reservation.date} ${reservation.start_time}`, 'YYYYMMDD HHmm') | ||
const end_datetime = moment( | ||
`${reservation.date} ${reservation.end_time}`, 'YYYYMMDD HHmm') | ||
|
||
const isOutdated = moment() > end_datetime; | ||
const isNow = start_datetime <= moment() && moment() <= end_datetime; | ||
|
||
return ( | ||
<EquipmentReservationConfirmModal | ||
key={reservation.uuid} | ||
reservation={reservation} | ||
trigger={ | ||
<Table.Row key={reservation.uuid} negative={isOutdated} positive={isNow}> | ||
<Table.Cell>{startIdx + idx + 1}</Table.Cell> | ||
<Table.Cell> | ||
{ | ||
reservation.equipments.map(equipment => { | ||
return ( | ||
<Label | ||
size={"tiny"} | ||
key={equipment.uuid} | ||
style={{margin: "2px"}} | ||
> | ||
{equipment.name} | ||
</Label> | ||
) | ||
}) | ||
} | ||
</Table.Cell> | ||
<Table.Cell>{reservation.booker.name}</Table.Cell> | ||
<Table.Cell>{reservation.title}</Table.Cell> | ||
<Table.Cell> | ||
<b> | ||
{moment(reservation.date, 'YYYYMMDD'). | ||
format('YYYY년 MM월 DD일')} | ||
<br/> | ||
{moment(reservation.start_time, 'HHmm'). | ||
format('HH:mm')} | ||
~ | ||
{moment(reservation.end_time, 'HHmm'). | ||
format('HH:mm')} | ||
</b> | ||
</Table.Cell> | ||
<Table.Cell>{reservation.status}</Table.Cell> | ||
</Table.Row> | ||
} | ||
/> | ||
) | ||
}) | ||
} | ||
</Table.Body> | ||
</Table> | ||
) | ||
} | ||
|
||
export default EquipmentReservationWaitTable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { KoreanWeekday } from '@/utils/opening_hours' | ||
|
||
const OpeningHoursList = ({ openingHours }) => { | ||
let isBriefCase; | ||
if (openingHours['Everyday']) { | ||
isBriefCase = false; | ||
} else { | ||
let cnt = 0; | ||
for(const day of Object.keys(openingHours)) { | ||
if(openingHours[day] === '00:00-24:00') { | ||
cnt += 1; | ||
} | ||
} | ||
isBriefCase = (cnt > 5); | ||
} | ||
|
||
return ( | ||
<div style={{ width: '100%' }}> | ||
{ | ||
Object.keys(openingHours).map(day => { | ||
if(isBriefCase && openingHours[day] === '00:00-24:00') { | ||
return; | ||
} | ||
|
||
return ( | ||
<div key={day} style={{ display: 'flex', margin: 0 }}> | ||
<div style={{ flex: 2, margin: 0 }}> | ||
{KoreanWeekday[day]}: | ||
</div> | ||
<div style={{ flex: 4, margin: 0 }}> | ||
{openingHours[day]} | ||
</div> | ||
</div> | ||
) | ||
}, | ||
) | ||
} | ||
{ | ||
isBriefCase ? ( | ||
<div key={'others'} style={{ display: 'flex', margin: 0 }}> | ||
<div style={{ flex: 2, margin: 0 }}>그외:</div> | ||
<div style={{ flex: 4, margin: 0 }}> | ||
00:00-24:00 | ||
</div> | ||
</div> | ||
) : null | ||
} | ||
</div> | ||
) | ||
} | ||
|
||
export default OpeningHoursList |
Oops, something went wrong.