diff --git a/src/pages/manager/officeBookingManage/OfficeBookingManageCell.js b/src/pages/manager/officeBookingManage/OfficeBookingManageCell.js index b233be6..b9d17c2 100644 --- a/src/pages/manager/officeBookingManage/OfficeBookingManageCell.js +++ b/src/pages/manager/officeBookingManage/OfficeBookingManageCell.js @@ -7,21 +7,23 @@ import styled from 'styled-components'; import { getToken } from 'utils/IsLoginUtil'; import { basicError } from 'utils/ErrorHandlerUtil'; -const SettingButtonContainer = styled.div` +export const SettingButtonContainer = styled.div` display: flex; width: 90%; height: 100%; align-items: center; justify-content: flex-end; ` -const SettingButton = styled.button` - color: #8741CB; - font-size: 20px; - font-style: normal; - font-weight: 400; - line-height: 22px; - background: none; - border: none; +export const SettingButton = styled.button` + color: #8741CB; + font-size: 18px; + font-style: normal; + font-weight: 400; + line-height: 22px; + background: none; + border: none; + cursor: pointer; + ` @@ -37,7 +39,7 @@ function OfficeBookingManageCell(props) { Authorization: getToken() } }) - .then((Response) => { + .then((Response) => { alert(Response.data.message) window.location.reload() }) @@ -63,7 +65,7 @@ function OfficeBookingManageCell(props) { var usingButton = ( - 반려 |상세보기 + 반려 |상세보기 ) return ( @@ -85,4 +87,4 @@ function OfficeBookingManageCell(props) { ) } -export default OfficeBookingManageCell; \ No newline at end of file +export default OfficeBookingManageCell; diff --git a/src/pages/manager/resourceBookingManage/ResourceBookingManageCell.js b/src/pages/manager/resourceBookingManage/ResourceBookingManageCell.js index 99ab625..a820cc5 100644 --- a/src/pages/manager/resourceBookingManage/ResourceBookingManageCell.js +++ b/src/pages/manager/resourceBookingManage/ResourceBookingManageCell.js @@ -2,30 +2,12 @@ import React from 'react'; import { Link } from 'react-router-dom'; import { BookedLineTr } from '../../booking/bookedList/BookedList'; import { StatusCircle, StatusContainer, StatusText } from 'components/booking/StatusTag'; -import { CANCELED, USING, WAITING, findStatus } from 'constants/BookingStatus'; +import {CANCELED, USING, WAITING, findStatus, BOOKED} from 'constants/BookingStatus'; import { AdminBookingAxios } from 'api/AxiosApi'; import styled from 'styled-components'; import { getToken } from 'utils/IsLoginUtil'; import { basicError } from 'utils/ErrorHandlerUtil'; - -const SettingButtonContainer = styled.div` - display: flex; - width: 90%; - height: 100%; - align-items: center; - justify-content: flex-end; -` -const SettingButton = styled.button` - color: #8741CB; - font-size: 20px; - font-style: normal; - font-weight: 400; - line-height: 22px; - background: none; - border: none; -` - - +import {SettingButton, SettingButtonContainer} from "../officeBookingManage/OfficeBookingManageCell"; function ResourceBookingManageCell(props) { @@ -37,7 +19,7 @@ function ResourceBookingManageCell(props) { Authorization: getToken() } }) - .then((Response) => { + .then((Response) => { alert(Response.data.message) window.location.reload() }) @@ -50,7 +32,7 @@ function ResourceBookingManageCell(props) { alert("예약 허가를 취소하셨습니다.") } - + }; const rejectResource = () => { @@ -61,7 +43,7 @@ function ResourceBookingManageCell(props) { Authorization: getToken() } }) - .then((Response) => { + .then((Response) => { alert(Response.data.message) window.location.reload() }) @@ -83,7 +65,7 @@ function ResourceBookingManageCell(props) { Authorization: getToken() } }) - .then((Response) => { + .then((Response) => { alert(Response.data.message) window.location.reload() }) @@ -103,10 +85,12 @@ function ResourceBookingManageCell(props) { + + var status = findStatus(props.status) var watingButton = ( - 허가 | 반려 | 상세보기 + 허가 | 반려 | 상세보기 ) var cancelButton = ( @@ -114,9 +98,17 @@ function ResourceBookingManageCell(props) { var usingButton = ( - 반납 | 상세보기 + 반납 | 상세보기 ) + + + var bookingButton = ( + + 반려 | 상세보기 + + ); + return ( {props.name} @@ -130,12 +122,13 @@ function ResourceBookingManageCell(props) { - {status === WAITING ? watingButton : - status === USING ? usingButton : cancelButton + {status === WAITING ? watingButton : + status === USING ? usingButton : + status === BOOKED ? bookingButton :cancelButton } ) } -export default ResourceBookingManageCell; \ No newline at end of file +export default ResourceBookingManageCell; diff --git a/src/pages/manager/resourceManage/ResourceManageAdd.js b/src/pages/manager/resourceManage/ResourceManageAdd.js index e5b2f10..ec5427e 100644 --- a/src/pages/manager/resourceManage/ResourceManageAdd.js +++ b/src/pages/manager/resourceManage/ResourceManageAdd.js @@ -156,7 +156,7 @@ function ResourceManageAdd(props) { const [selectCategory, setSelectCategory] = useState(""); const [description, setDescription] = useState(""); const [imageFile, setImageFile] = useState(null); - const [imageUrl, setImageUrl] = useState(""); + const [imageUrl, setImageUrl] = useState(null); const getCategories = () => { AdminBookingResourceAxios.get(`/category`, { @@ -199,14 +199,20 @@ function ResourceManageAdd(props) { if (imageFile !== null) { ImageUrlAxios.get(`?ext=${imageFile.type.split("/", 2)[1]}&dir=photo`) .then((Response) => { - alert(Response) + setImageUrl(Response.data); + uploadImage(); }) .catch((error) => { console.log(error) }); + }else { + addResource() } } + const uploadImage = () => { + console.log(imageUrl) + } const addResource = () => { AdminBookingResourceAxios.post(``, {