Skip to content

Commit

Permalink
Merge pull request #147 from PLADI-ALM/feat/PDW-32-office-add
Browse files Browse the repository at this point in the history
[PDW-32/feat] 회의실 추가 및 수정
  • Loading branch information
psyeon1120 authored Nov 27, 2023
2 parents 719c0c9 + e6a2163 commit 2cb00c3
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 14 deletions.
3 changes: 3 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import CarManage from "./pages/admin/car/CarManage";
import CarBookingManage from "./pages/admin/carBookings/CarBookingManage";
import CarManageAdd from "./pages/admin/car/CarManageAdd";
import CarManageDetail from "./pages/admin/car/CarManageDetail";
import OfficeManageAdd from "./pages/admin/office/OfficeManageAdd";

function App() {

Expand Down Expand Up @@ -52,6 +53,8 @@ function App() {
<Route path="/my/bookings/cars" element={<BookedList title="차량 예약 내역" type={"cars"} />} />
<Route path='/my/bookings/cars/:bookingId' element={<CarBookingCheck />} />
<Route path='/admin/offices' element={<OfficeManage />} />
<Route path='/admin/offices/add' element={<OfficeManageAdd />} />
<Route path='/admin/offices/:officeId/edit' element={<OfficeManageAdd />} />
<Route path='/admin/offices/:officeId' element={<OfficeManageDetail />} />
<Route path='/admin/officeBooking' element={<OfficeBookingManage />} />
<Route path='/admin/officeBooking/:bookingId' element={<OfficeBookingCheck isAdmin={true} />} />
Expand Down
39 changes: 39 additions & 0 deletions src/components/capsule/FacilityCapsule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from "react";
import styled from "styled-components"

const WhiteCapsule = styled.p`
border-radius: 20px;
background: white;
border: 1px solid #A263DE;
color: #A263DE;
text-align: center;
font-size: 18px;
padding: 7px 15px;
margin: 0 10px 0 0;
min-width: fit-content;
height: fit-content;
display: flex;
align-items: center;
z-index: 0;
`

const DeleteBtn = styled.button`
background: none;
font-size: 20px;
border: none;
color: #4C4C4C;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
margin-left: 10px;
padding: 0;
`

function FacilityCapsule(props) {
return (
<WhiteCapsule>{props.text}<DeleteBtn onClick={props.click}>×</DeleteBtn></WhiteCapsule>
);
}

export default FacilityCapsule;
14 changes: 7 additions & 7 deletions src/pages/admin/car/CarManageAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function CarManageAdd(props) {
description: null,
};
const [inputValues, setInputValues] = useState(initialValue);
const {name, manufacturer, place, description} = inputValues; //비구조화 할당
const {name, capacity, place, description} = inputValues; //비구조화 할당
const [staff, setStaff] = useState({
userId: null,
name: ""
Expand Down Expand Up @@ -213,7 +213,7 @@ function CarManageAdd(props) {
// 이미지 람다 호출
const getImageUrl = () => {
// todo: 검사 다 하기
if (staff.userId === null) {
if (staff.facilityId === null) {
alert("책임자를 선택해주세요.");
return;
}
Expand Down Expand Up @@ -264,9 +264,9 @@ function CarManageAdd(props) {

const addCar = () => {
AdminCarsAxios.post(``, {
responsibility: staff.userId,
responsibility: staff.facilityId,
description: description,
manufacturer: manufacturer,
manufacturer: capacity,
location: place,
name: name,
imgKey: imageFile === null ? null : `car/${imageUrl.imageKey}`,
Expand All @@ -287,9 +287,9 @@ function CarManageAdd(props) {

const editCar = () => {
AdminCarsAxios.patch(`/${carId}`, {
responsibility: staff.userId,
responsibility: staff.facilityId,
description: description,
manufacturer: manufacturer,
manufacturer: capacity,
location: place,
name: name,
imgKey: imageFile === null ? getImgKey(imageUrl) : `car/${imageUrl.imageKey}`,
Expand Down Expand Up @@ -374,7 +374,7 @@ function CarManageAdd(props) {

<ShortColumnContainer>
<TitleLabel>제조사</TitleLabel>
<InfoInput name='manufacturer' value={manufacturer} onChange={onChangeInput}/>
<InfoInput name='manufacturer' value={capacity} onChange={onChangeInput}/>
</ShortColumnContainer>

<ShortColumnContainer>
Expand Down
Loading

0 comments on commit 2cb00c3

Please sign in to comment.