diff --git a/frontend/src/Cabinet/components/CabinetList/CabinetList.container.tsx b/frontend/src/Cabinet/components/CabinetList/CabinetList.container.tsx index 1e9dd4fc2..89ebca973 100644 --- a/frontend/src/Cabinet/components/CabinetList/CabinetList.container.tsx +++ b/frontend/src/Cabinet/components/CabinetList/CabinetList.container.tsx @@ -9,6 +9,7 @@ import { currentSectionCabinetState, currentSectionColNumState, } from "@/Cabinet/recoil/selectors"; +import { DISABLED_FLOOR } from "@/Cabinet/pages/AvailablePage"; import CabinetList from "@/Cabinet/components/CabinetList/CabinetList"; import EmptySection from "@/Cabinet/components/CabinetList/EmptySection/EmptySection"; import RealViewNotification from "@/Cabinet/components/CabinetList/RealViewNotification/RealViewNotification"; @@ -19,10 +20,11 @@ import useMultiSelect from "@/Cabinet/hooks/useMultiSelect"; interface ICabinetListContainer { isAdmin: boolean; + currentFloor: number; } const CabinetListContainer = ({ - isAdmin, + isAdmin, currentFloor }: ICabinetListContainer): JSX.Element => { const colNum = useRecoilValue(currentSectionColNumState); const currentSectionCabinets = useRecoilValue( @@ -50,17 +52,23 @@ const CabinetListContainer = ({ /> )} - {currentFloorSectionNames.includes(currentSectionName) && ( + {currentFloorSectionNames.includes(currentSectionName) && !(DISABLED_FLOOR.includes(currentFloor.toString())) && ( )} - - {(currentSectionName === SectionType.elevator || - currentSectionName === SectionType.stairs) && ( - + {(!isAdmin && DISABLED_FLOOR.includes(currentFloor.toString())) ? ( + + ) : ( + <> + + {(currentSectionName === SectionType.elevator || + currentSectionName === SectionType.stairs) && ( + + )} + )} ); diff --git a/frontend/src/Cabinet/components/LeftNav/LeftMainNav/LeftMainNav.tsx b/frontend/src/Cabinet/components/LeftNav/LeftMainNav/LeftMainNav.tsx index c4119c0d4..38bdb1074 100644 --- a/frontend/src/Cabinet/components/LeftNav/LeftMainNav/LeftMainNav.tsx +++ b/frontend/src/Cabinet/components/LeftNav/LeftMainNav/LeftMainNav.tsx @@ -5,6 +5,7 @@ import { ReactComponent as ProfileImg } from "@/Cabinet/assets/images/profile-ci import { ReactComponent as SlackAlarmImg } from "@/Cabinet/assets/images/slack-alarm.svg"; import { ReactComponent as SlackImg } from "@/Cabinet/assets/images/slack.svg"; import { ReactComponent as StoreImg } from "@/Cabinet/assets/images/storeIconGray.svg"; +import { DISABLED_FLOOR } from "@/Cabinet/pages/AvailablePage"; interface ILeftMainNav { pathname: string; @@ -57,19 +58,21 @@ const LeftMainNav = ({ Home {floors && - floors.map((floor, index) => ( - onClickFloorButton(floor)} - key={index} - > - {floor + "층"} - - ))} + floors.map((floor, index) => + !(!isAdmin && DISABLED_FLOOR.includes(floor.toString())) ? ( + onClickFloorButton(floor)} + key={index} + > + {floor + "층"} + + ) : null + )} void }) => { const [currentFloorSection, setCurrentFloorSection] = useRecoilState( currentSectionNameState ); + const currentFloorNumber = useRecoilValue(currentFloorNumberState); const { pathname } = useLocation(); const isAdmin = pathname.includes("admin"); @@ -45,6 +47,7 @@ const LeftSectionNav = ({ closeLeftNav }: { closeLeftNav: () => void }) => { {!isAdmin && !isClubSection && + !DISABLED_FLOOR.includes(currentFloorNumber.toString()) && (section.alarmRegistered ? ( ) : ( diff --git a/frontend/src/Cabinet/components/MapInfo/MapFloorSelectOption/MapFloorSelectOption.tsx b/frontend/src/Cabinet/components/MapInfo/MapFloorSelectOption/MapFloorSelectOption.tsx index 241ed3484..9e7040198 100644 --- a/frontend/src/Cabinet/components/MapInfo/MapFloorSelectOption/MapFloorSelectOption.tsx +++ b/frontend/src/Cabinet/components/MapInfo/MapFloorSelectOption/MapFloorSelectOption.tsx @@ -1,4 +1,5 @@ import styled from "styled-components"; +import { DISABLED_FLOOR } from "@/Cabinet/pages/AvailablePage"; const MapFloorSelectOption: React.FC<{ selectFloor: Function; @@ -7,6 +8,7 @@ const MapFloorSelectOption: React.FC<{ return ( {floorInfo.map((info, idx) => ( + !(DISABLED_FLOOR.includes(info.toString())) && selectFloor(info)} diff --git a/frontend/src/Cabinet/components/MapInfo/MapInfo.tsx b/frontend/src/Cabinet/components/MapInfo/MapInfo.tsx index fd82be807..0ffc4c014 100644 --- a/frontend/src/Cabinet/components/MapInfo/MapInfo.tsx +++ b/frontend/src/Cabinet/components/MapInfo/MapInfo.tsx @@ -1,7 +1,9 @@ import styled from "styled-components"; import MapFloorSelect from "@/Cabinet/components/MapInfo/MapFloorSelect/MapFloorSelect"; import MapGrid from "@/Cabinet/components/MapInfo/MapGrid/MapGrid"; +import { DISABLED_FLOOR } from "@/Cabinet/pages/AvailablePage"; +const DEFAULT_FLOOR = 2; const MapInfo = ({ touchStart, touchEnd, @@ -12,11 +14,16 @@ const MapInfo = ({ }: { touchStart: React.TouchEventHandler; touchEnd: React.TouchEventHandler; - floor: number; + floor: number | undefined; setFloor: React.Dispatch>; floorInfo: number[]; closeMap: React.MouseEventHandler; }) => { + const currentFloor = floor ?? DEFAULT_FLOOR; + const validFloor = DISABLED_FLOOR.includes(currentFloor.toString()) + ? DEFAULT_FLOOR + : currentFloor; + return ( - - + + ); }; diff --git a/frontend/src/Cabinet/pages/MainPage.tsx b/frontend/src/Cabinet/pages/MainPage.tsx index 3550822bd..0901deb30 100644 --- a/frontend/src/Cabinet/pages/MainPage.tsx +++ b/frontend/src/Cabinet/pages/MainPage.tsx @@ -152,9 +152,10 @@ const MainPage = () => { - + {currentSectionName !== SectionType.elevator && - currentSectionName !== SectionType.stairs && ( + currentSectionName !== SectionType.stairs && + !DISABLED_FLOOR.includes(currentFloor.toString()) && ( { /> - +