Skip to content

Commit

Permalink
Merge pull request #63 from PLADI-ALM/feat/PDW-54-manager-resource-2
Browse files Browse the repository at this point in the history
[PDW-54/Fix] 자원 예약 상세보기 수정 및 Link 코드 삭제
  • Loading branch information
psyeon1120 authored Oct 11, 2023
2 parents 4c3c736 + 3845046 commit 60913b5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 57 deletions.
11 changes: 10 additions & 1 deletion src/components/resourceInfo/ResourceInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from "styled-components"
import Example from '../../assets/images/example.png'
import Capsule from "components/capsule/Capsule";
import { ResourceCard, CardText, DetailContainer, ResourceCardImage, InfoContainer, DescriptionContainer, OfficeContentText, ResourceTitle } from "components/card/Card";
import { useNavigate } from "react-router-dom";

// 자원명 컨테이너
const ResourceTitleContainer = styled.div`
Expand All @@ -12,9 +13,17 @@ const ResourceTitleContainer = styled.div`
`





function ResourceInfo(props) {
const moveToDetail = () => {
window.location.href = "/resourceBooking/"+props.resourceId
}


return (
<ResourceCard onClick={props.click}>
<ResourceCard onClick={props.detail===true ? moveToDetail : {}}>
<DetailContainer>
<ResourceCardImage src={Example} />

Expand Down
4 changes: 3 additions & 1 deletion src/pages/booking/selectResource/SelectResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, { useState, useEffect } from "react";
import styled from "styled-components";
import ResourceInfo from "components/resourceInfo/ResourceInfo";
import { ResourcesAxios } from "api/AxiosApi";
import { useNavigate } from "react-router-dom";


export const SearchTitleContainer = styled.div`
Expand Down Expand Up @@ -61,6 +62,7 @@ export const SearchDateInput = styled.input`
`

function SelectResource(props) {
const navigate = useNavigate();

const [resourceList, setResourceList] = useState([]);
const [resourceName, setResourceName] = useState("");
Expand Down Expand Up @@ -118,7 +120,7 @@ function SelectResource(props) {

<WhiteContainer>
<div className="cardList">
{resourceList.length === 0 ? <label>예약 가능한 자원이 없습니다.</label> : resourceList.map((resource) => <ResourceInfo key={resource.resourceId} name={resource.name} image={resource.imgUrl} category={resource.category} description={resource.description} />)}
{resourceList.length === 0 ? <label>예약 가능한 자원이 없습니다.</label> : resourceList.map((resource, index) => <ResourceInfo key={resource.index} detail={true} resourceId={resource.resourceId} name={resource.name} image={resource.imgUrl} category={resource.category} description={resource.description} />)}
</div>
</WhiteContainer>
</RightContainer>
Expand Down
26 changes: 8 additions & 18 deletions src/pages/manager/officeBookingManage/OfficeBookingManageCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,31 +49,21 @@ function OfficeBookingManageCell(props) {
}
};

const moveToDetail = () => {
window.location.href = `/manage/officeBooking/${props.id}`
};





var status = findStatus(props.status)
var cancelButton = (
<SettingButtonContainer>
<SettingButton><Link style={{
color: "#8741CB",
fontSize: "20px",
fontStyle: "normal",
fontWeight: "400",
lineHeight: "22px",
}}
to={`/manage/officeBooking/${props.id}`}>상세보기</Link></SettingButton>
</SettingButtonContainer>)
<SettingButtonContainer><SettingButton onClick={moveToDetail}>상세보기</SettingButton></SettingButtonContainer>)

var usingButton = (
<SettingButtonContainer>
<SettingButton onClick={rejectResource}>반려</SettingButton> | <SettingButton><Link to={`/manage/officeBooking/${props.id}`}
style={{
color: "#8741CB",
fontSize: "20px",
fontStyle: "normal",
fontWeight: "400",
lineHeight: "22px",
}}>상세보기</Link></SettingButton>
<SettingButton onClick={rejectResource}>반려</SettingButton> |<SettingButton onClick={moveToDetail}>상세보기</SettingButton>
</SettingButtonContainer>)

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,53 +96,24 @@ function ResourceBookingManageCell(props) {
}
};

const moveToDetail = () => {
window.location.href = `/manage/resourceBooking/${props.id}`
};



var status = findStatus(props.status)
var watingButton = (
<SettingButtonContainer>
<SettingButton onClick={allowResource}>허가</SettingButton> | <SettingButton onClick={rejectResource}>반려</SettingButton> |
<SettingButton>
<Link style={{
color: "#8741CB",
fontSize: "20px",
fontStyle: "normal",
fontWeight: "400",
lineHeight: "22px", }}
to={`/manage/resourceBooking/${props.id}`}>
상세보기
</Link>
</SettingButton>
<SettingButton onClick={allowResource}>허가</SettingButton> | <SettingButton onClick={rejectResource}>반려</SettingButton> | <SettingButton onClick={moveToDetail}>상세보기</SettingButton>
</SettingButtonContainer>)

var cancelButton = (
<SettingButtonContainer>
<SettingButton>
<Link style={{
color: "#8741CB",
fontSize: "20px",
fontStyle: "normal",
fontWeight: "400",
lineHeight: "22px", }}
to={`/manage/resourceBooking/${props.id}`}>
상세보기
</Link>
</SettingButton>
</SettingButtonContainer>)
<SettingButtonContainer><SettingButton onClick={moveToDetail}>상세보기</SettingButton></SettingButtonContainer>)

var usingButton = (
<SettingButtonContainer>
<SettingButton onClick={returnResource}>반납</SettingButton> |
<SettingButton>
<Link style={{
color: "#8741CB",
fontSize: "20px",
fontStyle: "normal",
fontWeight: "400",
lineHeight: "22px", }}
to={`/manage/resourceBooking/${props.id}`}>
상세보기
</Link>
</SettingButton>
<SettingButton onClick={returnResource}>반납</SettingButton> | <SettingButton onClick={moveToDetail}>상세보기</SettingButton>
</SettingButtonContainer>)

return (
Expand Down

0 comments on commit 60913b5

Please sign in to comment.