From 79ff3775af4a4884ca879ea7177b9cdc0dde206a Mon Sep 17 00:00:00 2001 From: psyeon1120 Date: Sat, 21 Oct 2023 17:51:48 +0900 Subject: [PATCH] =?UTF-8?q?[PDW-61]=20fix:=20=EC=9E=90=EC=9B=90=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=EB=AA=A9=EB=A1=9D=20UI=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/searchBar/ManageSearchBar.js | 2 + src/components/toggle/Toggle.js | 46 +++++++++++++++++++ src/pages/booking/bookedList/BookedList.js | 3 +- .../manager/resourceManage/ResourceManage.js | 21 +++++++-- .../resourceManage/ResourceManageTableCell.js | 21 +++++---- 5 files changed, 78 insertions(+), 15 deletions(-) create mode 100644 src/components/toggle/Toggle.js diff --git a/src/components/searchBar/ManageSearchBar.js b/src/components/searchBar/ManageSearchBar.js index 7f9d72b..e2e3707 100644 --- a/src/components/searchBar/ManageSearchBar.js +++ b/src/components/searchBar/ManageSearchBar.js @@ -29,6 +29,8 @@ const ManageSearchImage = styled.img` ` const ManageSearchText = styled.input` + padding-left: 10px; + font-size: 18px; font-family: NanumSquare_ac; width: 100%; height: 100%; diff --git a/src/components/toggle/Toggle.js b/src/components/toggle/Toggle.js new file mode 100644 index 0000000..3d6bdd9 --- /dev/null +++ b/src/components/toggle/Toggle.js @@ -0,0 +1,46 @@ +import styled, {css} from "styled-components"; +import {useState} from "react"; + +const ToggleBtn = styled.button` + width: 50px; + height: 30px; + border-radius: 30px; + border: none; + cursor: pointer; + background-color: ${(props) => (!props.toggle ? "#2A3042" : "#8741CB")}; + position: relative; + display: flex; + justify-content: center; + align-items: center; + transition: all 0.3s ease-in-out; + margin: 0 auto; +`; + +const Circle = styled.div` + background-color: white; + width: 20px; + height: 20px; + border-radius: 50px; + position: absolute; + left: 10%; + transition: all 0.3s ease-in-out; + ${(props) => + props.toggle && + css` + transform: translate(20px, 0); + transition: all 0.3s ease-in-out; + `} +`; + +export function Toggle(props) { + const [toggle, setToggle] = useState(false); + const clickedToggle = () => { + setToggle((prev) => !prev); + props.click(!toggle); + }; + return ( + + + + ); +} \ No newline at end of file diff --git a/src/pages/booking/bookedList/BookedList.js b/src/pages/booking/bookedList/BookedList.js index 2f60557..bfd7c11 100644 --- a/src/pages/booking/bookedList/BookedList.js +++ b/src/pages/booking/bookedList/BookedList.js @@ -23,6 +23,7 @@ export const Bar = styled.div` box-sizing: border-box; position: absolute; top: 0; + z-index: 1; ` // 네이비 바 밑의 테이블의 컨테이너 @@ -42,7 +43,7 @@ export const BookedThead = styled.thead` top: 0; border-radius: 12px; height: 60px; - z-index: 1; + z-index: 2; color: white; ` diff --git a/src/pages/manager/resourceManage/ResourceManage.js b/src/pages/manager/resourceManage/ResourceManage.js index 04682c1..e4404db 100644 --- a/src/pages/manager/resourceManage/ResourceManage.js +++ b/src/pages/manager/resourceManage/ResourceManage.js @@ -48,18 +48,29 @@ function ResourceManage(props) { - 자원명 - 카테고리 - 설명 + 장비명 + 보관장소 + 책임자 + 설명 + { resources.length === 0 ? - 자원 내역이 없습니다. + 자원 내역이 없습니다. : resources.map((resource) => - + )} diff --git a/src/pages/manager/resourceManage/ResourceManageTableCell.js b/src/pages/manager/resourceManage/ResourceManageTableCell.js index d06ddc2..677ab57 100644 --- a/src/pages/manager/resourceManage/ResourceManageTableCell.js +++ b/src/pages/manager/resourceManage/ResourceManageTableCell.js @@ -1,19 +1,22 @@ import React from 'react'; import { BookedLineTr } from '../../booking/bookedList/BookedList'; - - - +import {Toggle} from "../../../components/toggle/Toggle"; +import {Link} from "react-router-dom"; function ResourceManageTableCell(props) { - const moveToDetail = () => { - window.location.href = `/manage/resources/${props.id}` + + const changeToggle = (isEnable) => { + // todo: 활성/비활성 API 호출 + console.log(isEnable) } return ( - - {props.name} - {props.category} - {props.description} + + {props.name} + {props.location} + {props.user}({props.userPhone}) + {props.description} + ) }