From c2741ff4d2f701bf52bf380c42fc38070ceb4b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EA=B7=9C=ED=83=9C?= <79373803+KyuTae98@users.noreply.github.com> Date: Sun, 3 Dec 2023 14:38:43 +0900 Subject: [PATCH] Frontend (#184) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat. 새로 고침 버튼 개발[#46] * 새로 고침 버튼을 개발하여 클릭 시 다시 해당 정류장의 버스를 받는 기능을 개발하였다. Resolves #46 * feat. map component 리팩토링 * 지하철 기능을 위해 map component 리팩토링 하였습니다. * feat. 버스페이지 css작업 완료 * 버스페이지 css작업 완료 * feat. 입력 폼 변경 * 입력 부분에서 검색어 바뀔 때마다 서버에 요청 * feat. 지하철 page생성 지하철 page 뼈대를 만들었습니다. * feat. map-slice수정 * feat. subway page개발(v1.1) * feat. main화면 bus화면 디자인 변경 * 변경 했지만 반응형 추가 필요 * feat. 디자인 폰트, 버스 페이지 어느 정도 완성 * 디자인 폰트, 버스 페이지 80% 완성, 반응형으로 만들기 수정 * feat. 지하철 페이지 디자인에 맞춰 개발 * feat. 지하철 메뉴 * 지하철 메뉴에 해당하는 페이지 설정 * feat. 모바일 반응형 * 모바일 반응형 완료 아직 지하철 페이지는 개발 필요함 * feat. 환승 page개발 * feat. HashRouter로 변경 * BrowserRouter에서 HashRouter로 변경 * feat. 이모지 + 서버 * feat.지하철 수정 * feat. map focusing 수정 * feat. 휠체어 기능 하기 전 저장 * 휠체어 기능 하기 전 저장 * feat. 휠체어 수정 완료 * 휠체어 수정 완료 * feat. 디테일한 수정 * 디테일한 수정 * Update Api.js * feat. 약간의 수정 * 약간의 수정 * feat.폰트, 맵 초기화 수정 * 폰트, 맵 초기화 수정 * feat. 최종 수정 * 최종 수정 * Update StationItem.js * refac: typescript로 Refectoring중 * feat(front): ts변경 오류 다수 발견 * feat(front): gps기반 지도 중심 개발 * fix(front): Api 수정 * fix(front): map 변경 * feat: 간단 퍼블리싱(1) * feat:menuBar 수정(SVG로 표현) * feat(front): 모바일 환경에 맞게 수정 * feat(): busmode 완성 * feat: busmode 수정 * feat: 지하철 수정 * feat: 지하철 마무리 * feat: map Marker 클릭이벤트 등록 완료 * feat: 길찾기 솔루션 개발중 --- Backend/Frontend/creative/src/App.tsx | 4 + .../creative/src/component/auth/Api.ts | 4 + .../bus-component/busform/BusForm.tsx | 51 ++++------- .../bus-component/buslist/BusItem.tsx | 31 ++----- .../bus-component/buslist/BusList.tsx | 10 +-- .../bus-component/buslist/RefreshButton.tsx | 12 +-- .../bus-component/buslist/StationItem.tsx | 36 +++----- .../bus-component/busnumber/BusNumber.tsx | 6 +- .../creative/src/component/header/Header.tsx | 8 ++ .../creative/src/component/loding/Loding.tsx | 14 +++ .../map/{Mapping.tsx => BusMapping.tsx} | 31 ++++--- .../src/component/map/Mapping.module.css | 14 +-- .../src/component/map/SignMapping.tsx | 73 ++++++++++++++++ .../src/component/map/SubwayMapping.tsx | 49 +++++++++++ .../creative/src/component/menu/MenuBar.tsx | 43 +++++++++ .../component/sign-component/SignDetail.tsx | 42 +++++++++ .../sign-component/SignDetailGraph.tsx | 58 +++++++++++++ .../sign-component/SignDetailInfo.tsx | 42 +++++++++ .../src/component/sign-component/SignForm.tsx | 37 ++++++++ .../sign-component/SignFormButton.tsx | 39 +++++++++ .../component/sign-component/signSvg/BUS.svg | 1 + .../sign-component/signSvg/SUBWAY.svg | 1 + .../src/component/sign-component/signUtil.tsx | 6 ++ .../subwaybath/SubwayBathChairInfo.tsx | 23 +---- .../subwaydetail/SubwayDetail.tsx | 87 ++++++------------- .../subwayform/SubwayButton.tsx | 27 ------ .../subwayform/SubwayForm.tsx | 16 ++-- .../subwayform/SubwayInput.tsx | 24 ++--- .../subwayinfo/SubwayInfo.tsx | 40 +++++---- .../subwaylist/SubwayItems.tsx | 48 ++++------ .../subwaylist/SubwayList.tsx | 11 +-- .../subwaymenubar/SubwayBar.tsx | 2 +- .../subwaypanel/SubwayPanel.tsx | 2 +- .../creative/src/hook/useSignForm.tsx | 27 ++++++ .../creative/src/page/BusPage.module.css | 26 +----- .../Frontend/creative/src/page/BusPage.tsx | 25 +++--- .../creative/src/page/MainPage.module.css | 32 ++++++- .../creative/src/page/SIgnDetailPage.tsx | 18 ++++ .../src/page/SignDetailPage.module.css | 7 ++ .../creative/src/page/SignPage.module.css | 7 ++ .../Frontend/creative/src/page/SignPage.tsx | 20 +++++ .../subwaypage/SubwayBathchair.module.css | 29 +------ .../src/page/subwaypage/SubwayBathchair.tsx | 20 ++--- .../subwaypage/SubwayDetailPage.module.css | 26 +----- .../src/page/subwaypage/SubwayDetailPage.tsx | 16 ++-- .../page/subwaypage/SubwayElevator.module.css | 34 +------- .../src/page/subwaypage/SubwayElevator.tsx | 11 +-- .../src/page/subwaypage/SubwayPage.module.css | 27 +----- .../src/page/subwaypage/SubwayPage.tsx | 25 +++--- .../creative/src/promise/warmPromise.ts | 26 ++++++ .../Frontend/creative/src/store/Map-slice.ts | 10 +-- .../Frontend/creative/src/store/Sign-slice.ts | 33 +++++++ Backend/Frontend/creative/src/store/index.ts | 12 ++- 53 files changed, 816 insertions(+), 507 deletions(-) create mode 100644 Backend/Frontend/creative/src/component/loding/Loding.tsx rename Backend/Frontend/creative/src/component/map/{Mapping.tsx => BusMapping.tsx} (73%) create mode 100644 Backend/Frontend/creative/src/component/map/SignMapping.tsx create mode 100644 Backend/Frontend/creative/src/component/map/SubwayMapping.tsx create mode 100644 Backend/Frontend/creative/src/component/sign-component/SignDetail.tsx create mode 100644 Backend/Frontend/creative/src/component/sign-component/SignDetailGraph.tsx create mode 100644 Backend/Frontend/creative/src/component/sign-component/SignDetailInfo.tsx create mode 100644 Backend/Frontend/creative/src/component/sign-component/SignForm.tsx create mode 100644 Backend/Frontend/creative/src/component/sign-component/SignFormButton.tsx create mode 100644 Backend/Frontend/creative/src/component/sign-component/signSvg/BUS.svg create mode 100644 Backend/Frontend/creative/src/component/sign-component/signSvg/SUBWAY.svg create mode 100644 Backend/Frontend/creative/src/component/sign-component/signUtil.tsx delete mode 100644 Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayButton.tsx create mode 100644 Backend/Frontend/creative/src/hook/useSignForm.tsx create mode 100644 Backend/Frontend/creative/src/page/SIgnDetailPage.tsx create mode 100644 Backend/Frontend/creative/src/page/SignDetailPage.module.css create mode 100644 Backend/Frontend/creative/src/page/SignPage.module.css create mode 100644 Backend/Frontend/creative/src/page/SignPage.tsx create mode 100644 Backend/Frontend/creative/src/promise/warmPromise.ts create mode 100644 Backend/Frontend/creative/src/store/Sign-slice.ts diff --git a/Backend/Frontend/creative/src/App.tsx b/Backend/Frontend/creative/src/App.tsx index 2edf9e1..3143aaa 100644 --- a/Backend/Frontend/creative/src/App.tsx +++ b/Backend/Frontend/creative/src/App.tsx @@ -6,6 +6,8 @@ import SubwayPage from "./page/subwaypage/SubwayPage.tsx" import SubwayDetailPage from "./page/subwaypage/SubwayDetailPage.tsx" import SubwayElevatorPage from "./page/subwaypage/SubwayElevator.tsx"; import SubwayBathChairPage from "./page/subwaypage/SubwayBathchair.tsx"; +import SignPage from "./page/SignPage.tsx"; +import SignDetailPage from "./page/SIgnDetailPage.tsx"; //page마다 url을 따로 지정, 페이지에서 api를 호출할 때 필요한 파라미터를 제공 function App() { @@ -18,6 +20,8 @@ function App() { } /> } /> } /> + }/> + }/> ); diff --git a/Backend/Frontend/creative/src/component/auth/Api.ts b/Backend/Frontend/creative/src/component/auth/Api.ts index 8652ee6..d4c1b8b 100644 --- a/Backend/Frontend/creative/src/component/auth/Api.ts +++ b/Backend/Frontend/creative/src/component/auth/Api.ts @@ -1,6 +1,10 @@ import axios from "axios" export const api = axios.create({ +<<<<<<< HEAD + baseURL: "http://34.145.39.241:3005" +======= baseURL: "http://34.168.80.42:3005" +>>>>>>> a4564550bd27da525e96b6fc9b5b02b8210532dc }) diff --git a/Backend/Frontend/creative/src/component/bus-component/busform/BusForm.tsx b/Backend/Frontend/creative/src/component/bus-component/busform/BusForm.tsx index 52f98e9..c2158a8 100644 --- a/Backend/Frontend/creative/src/component/bus-component/busform/BusForm.tsx +++ b/Backend/Frontend/creative/src/component/bus-component/busform/BusForm.tsx @@ -1,4 +1,4 @@ -import React, {useRef} from "react"; +import React from "react"; import { useDispatch } from "react-redux"; import styled from "styled-components"; import { api } from "../../auth/Api.ts"; @@ -6,43 +6,26 @@ import { MapActions } from "../../../store/Map-slice.ts"; import { BusActions } from "../../../store/Bus-slice.ts"; const StyledForm = styled.form` - display:flex; - width: 100%; - height: 140px; - border: 4px solid #CDD029; + display: flex; + position: fixed; + z-index: 100; + top: 15vh; + height: 1vh; + width: 80vw; .busFormInput{ - width: 80%; - height: 80%; - padding: 15px; - font-size: 2.5vw; - border:0; + width: 100%; + padding: 1em; + font-size: 80%; font-family: 'Pretendard-Regular'; font-weight: 700; - } - .busFormBtn{ - width: 20%; - height: 100%; - background: #CDD029; - border: 1px solid #CDD029; - padding:0; - } - @media (max-width:500px){ - width: 98vw; - height: 15vw; - .busFormInput{ - font-family: 'Pretendard-Regular'; - width: 80%; - height: 15vw; - font-size: 6vw; - padding: 1%; - } + border: 0; + border-radius: 30px; } ` - const BusForm:React.FC = () => { const dispatch = useDispatch(); - const inputRef = useRef(null); + const SubmitBusStation = (value: string|null) => { api .get(`/bus/stNm/${value}`) @@ -59,14 +42,16 @@ const BusForm:React.FC = () => { alert("해당 정류장이 없습니다."); }); }; + const BusStationData = (event:React.FormEvent) => { event.preventDefault(); - SubmitBusStation(inputRef.current!.value); + let [station]:any = (event.target as HTMLInputElement); + SubmitBusStation(station.value); }; + return ( - - + ); }; diff --git a/Backend/Frontend/creative/src/component/bus-component/buslist/BusItem.tsx b/Backend/Frontend/creative/src/component/bus-component/buslist/BusItem.tsx index d69abae..ef13034 100644 --- a/Backend/Frontend/creative/src/component/bus-component/buslist/BusItem.tsx +++ b/Backend/Frontend/creative/src/component/bus-component/buslist/BusItem.tsx @@ -6,14 +6,15 @@ const StyledBusItem = styled.li` justify-content: space-between; align-items: center; width: 100%; + min-height: 10%; list-style: none; text-align: center; border-bottom: 1px solid #d2d2d2; font-family: "Pretendard-Regular"; .mark { - width: 1.5vw; - height: 1.5vw; - margin-right: 0.8vw; + width: 1em; + height: 1em; + margin-right: 0.5rem; } :hover { cursor: pointer; @@ -38,7 +39,7 @@ const StyledBusItem = styled.li` font-family: "Pretendard-Regular"; font-style: normal; font-weight: 600; - font-size: 2vw; + font-size: 1em; line-height: 60px; margin-right: 10px; } @@ -46,7 +47,7 @@ const StyledBusItem = styled.li` font-family: "Pretendard-Regular"; font-style: normal; font-weight: 600; - font-size: 1.3vw; + font-size: 1em; line-height: 29px; } .id { @@ -54,28 +55,10 @@ const StyledBusItem = styled.li` font-family: "Pretendard-Regular"; font-style: normal; font-weight: 600; - font-size: 1.5vw; + font-size: 1em; line-height: 29px; color: #9c9c9c; } - - @media (max-width: 500px) { - height: 28%; - .Name { - font-size: 5vw; - } - .direction { - font-size: 3vw; - } - .id { - font-size: 3vw; - } - .mark { - width: 100%; - height: 100%; - margin-right: 2vw; - } - } `; const BusItem = (props:any) => { diff --git a/Backend/Frontend/creative/src/component/bus-component/buslist/BusList.tsx b/Backend/Frontend/creative/src/component/bus-component/buslist/BusList.tsx index 04914c4..62a3f1c 100644 --- a/Backend/Frontend/creative/src/component/bus-component/buslist/BusList.tsx +++ b/Backend/Frontend/creative/src/component/bus-component/buslist/BusList.tsx @@ -12,17 +12,11 @@ flex-direction:column; align-items: center; box-sizing: border-box; width: 100%; -height: 640px; -background: #FFFFFF; -border: 4px solid #CDD029 ; +max-height:50%; +min-height:50%; padding:0; margin:0; overflow:auto; -@media (max-width:500px) { - border: 4px solid #CDD029 ; - width:100%; - height:30vh; -} ` diff --git a/Backend/Frontend/creative/src/component/bus-component/buslist/RefreshButton.tsx b/Backend/Frontend/creative/src/component/bus-component/buslist/RefreshButton.tsx index e38e95c..6eeb135 100644 --- a/Backend/Frontend/creative/src/component/bus-component/buslist/RefreshButton.tsx +++ b/Backend/Frontend/creative/src/component/bus-component/buslist/RefreshButton.tsx @@ -6,8 +6,8 @@ import { BusActions } from "../../../store/Bus-slice.ts"; import { RootState } from "../../../store/index.ts"; const StyledRefreshButton = styled.button` - width: 3vw; - height: 3vw; + width: 2em; + height: 2em; border: 0; border-radius: 50px; background-color: transparent; @@ -19,14 +19,6 @@ const StyledRefreshButton = styled.button` :hover { cursor: pointer; } - @media (max-width: 500px) { - width: 10vw; - height: 10vw; - img { - width: 70%; - height: 70%; - } - } `; const RefreshButton = () => { diff --git a/Backend/Frontend/creative/src/component/bus-component/buslist/StationItem.tsx b/Backend/Frontend/creative/src/component/bus-component/buslist/StationItem.tsx index ed23bd4..116a4cd 100644 --- a/Backend/Frontend/creative/src/component/bus-component/buslist/StationItem.tsx +++ b/Backend/Frontend/creative/src/component/bus-component/buslist/StationItem.tsx @@ -8,20 +8,19 @@ import { useEffect, useState } from "react"; import { RootState } from "../../../store/index.ts"; interface stItem { - color:any; + color:string; } const StationItem = (props:any) => { - const [color, setColor] = useState(false); + const [color, setColor] = useState("false"); const { stNm, arsId, tmX, tmY } = props.items; - const dispatch = useDispatch(); const station = useSelector((state:RootState) => state.bus.currentStation); useEffect(() => { if (station === arsId) { - setColor(false); + setColor("false"); } else { - setColor(true); + setColor("true"); } }, [arsId, station]); @@ -29,7 +28,7 @@ const StationItem = (props:any) => { if (station === arsId) { SubmitStation(); } else if (station !== arsId) { - setColor(false); + setColor("false"); dispatch(BusActions.ClickStation(arsId)); dispatch(MapActions.positioning({ tmX, tmY })); } @@ -63,7 +62,7 @@ const StyledStationItem = styled.li` width: 100%; list-style: none; border-bottom: 1px solid #d2d2d2; - background-color: ${props => (props.color ? "#FFFFFF" : "#CDD029")}; + background-color: ${props => (props.color==="true" ? "#FFFFFF" : "#FFD12D")}; font-family: "Pretendard-Regular"; :hover { cursor: pointer; @@ -73,34 +72,23 @@ const StyledStationItem = styled.li` padding-left: 20px; font-family: "Pretendard-Regular"; font-style: normal; - font-weight: ${props => (props.color ? "400" : "700")}; - font-size: 2vw; + font-weight: ${props => (props.color==="true" ? "400" : "700")}; + font-size: 1em; line-height: 60px; - color: ${props => (props.color ? "#000000" : "#FFFFFF")}; + color: ${props => (props.color==="true" ? "#000000" : "#FFFFFF")}; } .id { padding-right: 20px; font-family: "Pretendard-Regular"; font-style: normal; - font-weight: ${props => (props.color ? "500" : "700")}; - font-size: 1.7vw; + font-weight: ${props => (props.color==="true" ? "500" : "700")}; + font-size: 1em; line-height: 29px; display: flex; align-items: center; text-align: center; - color: ${props => (props.color ? "#000000" : "#FFFFFF")}; - } - @media (max-width: 500px) { - height: 35%; - .Name { - font-family: "Pretendard-Regular"; - font-size: 5vw; - } - .id { - font-family: "Pretendard-Regular"; - font-size: 3vw; - } + color: ${props => (props.color==="true" ? "#000000" : "#FFFFFF")}; } `; diff --git a/Backend/Frontend/creative/src/component/bus-component/busnumber/BusNumber.tsx b/Backend/Frontend/creative/src/component/bus-component/busnumber/BusNumber.tsx index 00f4c88..2613da0 100644 --- a/Backend/Frontend/creative/src/component/bus-component/busnumber/BusNumber.tsx +++ b/Backend/Frontend/creative/src/component/bus-component/busnumber/BusNumber.tsx @@ -12,17 +12,13 @@ align-items:center; height:50px; width:90%; height:auto; -font-size:1.9vw; +font-size:1em; font-family: 'Pretendard-Regular'; padding:0; p{ font-weight:bold; margin:0; } -@media (max-width:500px){ - font-size:4.5vw; - height:20%; -} ` const BusNumber = (props:any) => { diff --git a/Backend/Frontend/creative/src/component/header/Header.tsx b/Backend/Frontend/creative/src/component/header/Header.tsx index 9092ef1..73e96c1 100644 --- a/Backend/Frontend/creative/src/component/header/Header.tsx +++ b/Backend/Frontend/creative/src/component/header/Header.tsx @@ -8,14 +8,22 @@ import { MapActions } from "../../store/Map-slice.ts"; const StyledHeader = styled.header` display:flex; +position: fixed; +top: 0; +z-index: 100; justify-content:space-between; +background-color: #FFFFFF; align-items:center; position:fixed; top: 0; font-family: 'GmarketSansMedium'; border-bottom: 2px solid #EBEBEB; width:100vw; +<<<<<<< HEAD +height:10vh; +======= min-height:8vh; +>>>>>>> a4564550bd27da525e96b6fc9b5b02b8210532dc .header_home{ font-size:5vw; color:#000000; diff --git a/Backend/Frontend/creative/src/component/loding/Loding.tsx b/Backend/Frontend/creative/src/component/loding/Loding.tsx new file mode 100644 index 0000000..fe2728f --- /dev/null +++ b/Backend/Frontend/creative/src/component/loding/Loding.tsx @@ -0,0 +1,14 @@ +import React from "react"; + + + + +const Loding = () => { + return ( +
+ Loding... +
+ ) +} + +export default Loding \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/map/Mapping.tsx b/Backend/Frontend/creative/src/component/map/BusMapping.tsx similarity index 73% rename from Backend/Frontend/creative/src/component/map/Mapping.tsx rename to Backend/Frontend/creative/src/component/map/BusMapping.tsx index 4fcd2ac..387e29b 100644 --- a/Backend/Frontend/creative/src/component/map/Mapping.tsx +++ b/Backend/Frontend/creative/src/component/map/BusMapping.tsx @@ -2,7 +2,7 @@ import React,{ useEffect } from "react"; import { useSelector, useDispatch } from 'react-redux'; import usePosition from "../../hook/usePosition.tsx"; - +import { geolocationOptions } from "../../contents/geolocationOptions.tsx"; import classes from "./Mapping.module.css" import { api } from "../auth/Api.ts"; import { BusActions } from "../../store/Bus-slice.ts"; @@ -13,11 +13,21 @@ declare global { kakao: any; } } - const Mapping = () => { const dispatch = useDispatch() const marker = useSelector((state:RootState) => state.map.marker) const position = useSelector((state:RootState) => state.map.position) +<<<<<<< HEAD:Backend/Frontend/creative/src/component/map/BusMapping.tsx + const arsid = useSelector((state:RootState)=> state.bus.currentStation); + const busmode = useSelector((state:RootState) => state.map.busmode); + const {curPosition} = usePosition(geolocationOptions); + const tmY = curPosition ? curPosition.tmY: position.tmY; + const tmX = curPosition ? curPosition.tmX: position.tmX; + useEffect(() => { + const container = document.getElementById("busmap"); + const x = position.tmX!==0?Number(position.tmX):tmX!==0?tmX:37.55068403524657; + const y = position.tmY!==0?Number(position.tmY):tmY!==0?tmY:127.07411251036736; +======= const arsid = useSelector((state:RootState) => state.bus.currentStation) const busmode = useSelector((state:RootState) => state.map.busmode) const subwaymode = useSelector((state:RootState) => state.map.subwaymode) @@ -27,13 +37,18 @@ const Mapping = () => { useEffect(() => { console.log(tmX,tmY); const container = document.getElementById("map"); +>>>>>>> a4564550bd27da525e96b6fc9b5b02b8210532dc:Backend/Frontend/creative/src/component/map/Mapping.tsx const options = { - center: new window.kakao.maps.LatLng(tmY, tmX), + center: new window.kakao.maps.LatLng(y, x), level: 3, }; const map = new window.kakao.maps.Map(container, options); if (busmode) busmapcoordinate(marker, map) +<<<<<<< HEAD:Backend/Frontend/creative/src/component/map/BusMapping.tsx + },[tmX,tmY,busmode,arsid,position]) + +======= else if (subwaymode) subwaymapcoordinate(marker, map) },[tmX,tmY]) @@ -47,25 +62,19 @@ const Mapping = () => { new_marker.setMap(map) } +>>>>>>> a4564550bd27da525e96b6fc9b5b02b8210532dc:Backend/Frontend/creative/src/component/map/Mapping.tsx const busmapcoordinate = (marker:any, map:any) => { - - const currentArsid = marker.filter((id:any) => id.arsId === arsid) marker.forEach((element:any) => { const imageSrc = './image/busImage.png' // 마커이미지의 주소입니다 const imageSize = new window.kakao.maps.Size(64, 69) const imageOption = { offset: new window.kakao.maps.Point(27, 69) }; let markerImage = new window.kakao.maps.MarkerImage(imageSrc, imageSize, imageOption) - const markerPosition = new window.kakao.maps.LatLng(parseFloat(String(element.tmY - 0.0000005)).toFixed(6), parseFloat(String(element.tmX - 0.0000005)).toFixed(6)) - if (element.arsId !== currentArsid[0].arsId) { - markerImage = undefined; - } const new_marker = new window.kakao.maps.Marker({ position: markerPosition, clickable: true, image: markerImage }) - window.kakao.maps.event.addListener(new_marker, 'click', () => { submitStationId(element.arsId) }) @@ -85,7 +94,7 @@ const Mapping = () => { } return ( -
+
) } diff --git a/Backend/Frontend/creative/src/component/map/Mapping.module.css b/Backend/Frontend/creative/src/component/map/Mapping.module.css index 14f1bed..42d4e28 100644 --- a/Backend/Frontend/creative/src/component/map/Mapping.module.css +++ b/Backend/Frontend/creative/src/component/map/Mapping.module.css @@ -1,12 +1,4 @@ -.map { - width: 35vw; - height: 80vh; - +.busmap, .subwaymap, .signmap { + width: 100vw; + height: 80%; } - -@media (max-width:500px) { - .map { - width: 99%; - height: 40vh; - } -} \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/map/SignMapping.tsx b/Backend/Frontend/creative/src/component/map/SignMapping.tsx new file mode 100644 index 0000000..808e8b4 --- /dev/null +++ b/Backend/Frontend/creative/src/component/map/SignMapping.tsx @@ -0,0 +1,73 @@ +import React,{ useState, useEffect } from "react"; +import { useSelector, useDispatch } from 'react-redux'; + +import usePosition from "../../hook/usePosition.tsx"; +import { geolocationOptions } from "../../contents/geolocationOptions.tsx"; +import classes from "./Mapping.module.css" +import { RootState } from "../../store/index"; +import { SignActions } from "../../store/Sign-slice.ts"; + +declare global { + interface Window { + kakao: any; + } + } +const Mapping = () => { + const dispatch = useDispatch(); + const [map,setMap] = useState(null); + const [start,setStart] = useState(null); + const [end,setEnd] = useState(null); + const [prev,setPrev] = useState(start); + const position = useSelector((state:RootState) => state.map.position) + const {curPosition} = usePosition(geolocationOptions); + const state = useSelector((state:RootState)=>state.sign.State); + const tmY = curPosition ? curPosition.tmY: position.tmY; + const tmX = curPosition ? curPosition.tmX: position.tmX; + useEffect(() => { + const container = document.getElementById("signmap"); + const x = position.tmX!==0?Number(position.tmX):tmX!==0?tmX:37.55068403524657; + const y = position.tmY!==0?Number(position.tmY):tmY!==0?tmY:127.07411251036736; + const options = { + center: new window.kakao.maps.LatLng(y, x), + level: 3, + }; + const map = new window.kakao.maps.Map(container, options); + setMap(map); + const Startmarker = new window.kakao.maps.Marker({ + position:map.getCenter() + }) + Startmarker.setMap(map); + const Endmarker = new window.kakao.maps.Marker({ + position:map.getCenter() + }) + Endmarker.setMap(map); + setStart(Startmarker) + setEnd(Endmarker); + },[tmX,tmY,position]) + + const moveMarker = (mouseEvent:any) => { + let latlng = mouseEvent!.latLng; + if(state==="start"){ + start.setPosition(latlng); + dispatch(SignActions.initializationStart(latlng)) + } + else if(state==="end"){ + end.setPosition(latlng); + dispatch(SignActions.initializationEnd(latlng)) + } + window.kakao.maps.event.removeListener(map,"click", moveMarker) + } + + const changeStateMarker = () => { + window.kakao.maps.event.addListener(map,"click", moveMarker) + } + if(map&&state!=="") + changeStateMarker(); + + return ( +
+
+ ) +} + +export default Mapping; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/map/SubwayMapping.tsx b/Backend/Frontend/creative/src/component/map/SubwayMapping.tsx new file mode 100644 index 0000000..7480eb9 --- /dev/null +++ b/Backend/Frontend/creative/src/component/map/SubwayMapping.tsx @@ -0,0 +1,49 @@ +import React,{ useEffect } from "react"; +import { useSelector } from 'react-redux'; + +import usePosition from "../../hook/usePosition.tsx"; +import { geolocationOptions } from "../../contents/geolocationOptions.tsx"; +import classes from "./Mapping.module.css" +import { RootState } from "../../store/index"; + +declare global { + interface Window { + kakao: any; + } + } +const Mapping = () => { + const marker = useSelector((state:RootState) => state.map.marker) + const position = useSelector((state:RootState) => state.map.position) + const subwaymode = useSelector((state:RootState) => state.map.subwaymode); + const {curPosition} = usePosition(geolocationOptions); + const tmY = curPosition ? curPosition.tmY: position.tmY; + const tmX = curPosition ? curPosition.tmX: position.tmX; + useEffect(() => { + const container = document.getElementById("subwaymap"); + const x = position.tmX!==0?Number(position.tmX):tmX!==0?tmX:37.55068403524657; + const y = position.tmY!==0?Number(position.tmY):tmY!==0?tmY:127.07411251036736; + const options = { + center: new window.kakao.maps.LatLng(y, x), + level: 3, + }; + const map = new window.kakao.maps.Map(container, options); + if (subwaymode) + subwaymapcoordinate(marker, map) + },[tmX,tmY,subwaymode,position]) + + const subwaymapcoordinate = (marker:any, map:any) => { + const markerPosition = new window.kakao.maps.LatLng(parseFloat(String(marker.tmY - 0.0000005)).toFixed(6), parseFloat(String(marker.tmX - 0.0000005)).toFixed(6)) + const new_marker = new window.kakao.maps.Marker({ + position: markerPosition, + clickable: true, + }) + new_marker.setMap(map) + }//마커 찍는 함수 + + return ( +
+
+ ) +} + +export default Mapping; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/menu/MenuBar.tsx b/Backend/Frontend/creative/src/component/menu/MenuBar.tsx index 0cfa2fa..54a85ff 100644 --- a/Backend/Frontend/creative/src/component/menu/MenuBar.tsx +++ b/Backend/Frontend/creative/src/component/menu/MenuBar.tsx @@ -1,11 +1,53 @@ import React from "react" import styled from "styled-components" +<<<<<<< HEAD +import { NavLink } from "react-router-dom"; +======= +>>>>>>> a4564550bd27da525e96b6fc9b5b02b8210532dc import {ReactComponent as HOME} from "./menuSvg/HOME.svg"; import {ReactComponent as BUS} from "./menuSvg/BUS.svg"; import {ReactComponent as SUBWAY} from "./menuSvg/SUBWAY.svg"; import {ReactComponent as SIGN} from "./menuSvg/SIGN.svg"; +<<<<<<< HEAD + +const StyleMenuBar = styled.div` +display:flex; +justify-content: space-evenly; +position: fixed; +bottom: 0; +align-items: center; +width: 100%; +min-height: 10%; +background-color: #FFD12D; +text-decoration:none; +` + +const MenuBar = () => { + return ( + + + {({isActive}:{isActive:boolean})=>( + isActive?: + )} + + + {({isActive}:{isActive:boolean})=>( + isActive?: + )} + + + {({isActive}:{isActive:boolean})=>( + isActive?: + )} + + + {({isActive}:{isActive:boolean})=>( + isActive?: + )} + +======= @@ -41,6 +83,7 @@ const MenuBar = () => { +>>>>>>> a4564550bd27da525e96b6fc9b5b02b8210532dc ) } diff --git a/Backend/Frontend/creative/src/component/sign-component/SignDetail.tsx b/Backend/Frontend/creative/src/component/sign-component/SignDetail.tsx new file mode 100644 index 0000000..51fe51b --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/SignDetail.tsx @@ -0,0 +1,42 @@ +import React from "react" +import styled from "styled-components" +import useSignForm from "../../hook/useSignForm.tsx"; +import SignDetailGraph from "./SignDetailGraph.tsx"; +import SignDetailInfo from "./SignDetailInfo.tsx"; + +const StyledSignDetail = styled.main` + width: 90%; + height: 80%; + display: flex; + flex-direction: column; + font-family: "Pretendard-Regular"; + font-style: normal; + overflow: auto; + .detail{ + margin-top: 1.2em; + padding-bottom: 1em; + border-bottom: solid 1px; + } +` + + +//그래프에 필요한것 1. type 2. 시간을 준다. +const SignDetail = () => { + const arr = useSignForm(); + return ( + + {arr[0].length!==0&&arr[0].map((ele:any,index:number)=>{ + return ( +
+ {ele.info.totalTime}분 + + +
+ ) + })} +
+ ) +} + + +export default SignDetail; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/SignDetailGraph.tsx b/Backend/Frontend/creative/src/component/sign-component/SignDetailGraph.tsx new file mode 100644 index 0000000..29d7e23 --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/SignDetailGraph.tsx @@ -0,0 +1,58 @@ +import React from "react"; +import styled from "styled-components"; + + +interface graphItem { + label:string, + portion:number, + sum:number +} + +const StyleSignDetailGraph = styled.div` + display: flex; + width:100%; + height: 3vh; + background-color: #D9D9D9; + justify-content: space-between; + border-radius: 10px; +` +const StyleSignDetailGraphLi = styled.div` + display: flex; + align-items: center; + justify-content: center; + height: 100%; + min-width: ${props => ((props.portion/props.sum)*100)}%; + background-color: ${props=>(props.label)}; + border-radius: 10px; + margin-right: 1%; + color:#F0F0F0; + font-family: "Pretendard-Regular"; + font-style: normal; +` + +const SignDetailGraph = ({graph}:any) => { + const idColor = ["#0052A4", "#00A84D", "#EF7C1C", "#00A5DE", "#996CAC", "#CD7C2F", "#747F00", "#E6186C","#BDB092"]; + const busColor = "#70EB37" + return ( + + {graph.subPath.map((ele:any,index:number)=>{ + if(ele.sectionTime!==0){ + let color="#D9D9D9"; + if(ele.trafficType===1){ + color = idColor[ele.lane[0].subwayCode-1] + } + else if(ele.trafficType===2){ + color = busColor; + } + return ( + + {ele.sectionTime}분 + + ) + } + })} + + ) +} + +export default SignDetailGraph; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/SignDetailInfo.tsx b/Backend/Frontend/creative/src/component/sign-component/SignDetailInfo.tsx new file mode 100644 index 0000000..cc5a01a --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/SignDetailInfo.tsx @@ -0,0 +1,42 @@ +import React from "react"; +import styled from "styled-components"; + +const StyledSignDetailInfo = styled.div` + display: flex; + flex-direction: column; +` + +const StyledSignDetailInfoLi = styled.div` + display: flex; + flex-direction: column; + margin:1em 0; + font-family: "Pretendard-Regular"; + font-style: normal; + .SignDetail{ + margin-top: 1px; + } +` + +const SignDetailInfo = ({graph}:any) => { + + return ( + + {graph.subPath.map((ele:any,index:number)=>{ + if(ele.trafficType!==3){ + let name = ele.lane[0].busNo?ele.lane[0].busNo:ele.lane[0].name + return ( + + {name} +
+ {ele.endName} - + {ele.startName} +
+
+ ) + } + })} +
+ ) +} + +export default SignDetailInfo; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/SignForm.tsx b/Backend/Frontend/creative/src/component/sign-component/SignForm.tsx new file mode 100644 index 0000000..1b33581 --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/SignForm.tsx @@ -0,0 +1,37 @@ +import React from "react"; + +import SignFormButton from "./SignFormButton.tsx"; + +import styled from "styled-components"; + +const StyledForm = styled.form` + display: flex; + position: fixed; + z-index: 100; + top: 15vh; + height: 1vh; + width: 85vw; + .signFormInput{ + width: 100%; + padding: 1em; + font-size: 80%; + font-family: 'Pretendard-Regular'; + font-weight: 700; + border: 0; + border-radius: 30px; + } +` + + +const SignForm = () =>{ + return ( + + + + + + + ) +} + +export default SignForm; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/SignFormButton.tsx b/Backend/Frontend/creative/src/component/sign-component/SignFormButton.tsx new file mode 100644 index 0000000..e1b33b2 --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/SignFormButton.tsx @@ -0,0 +1,39 @@ +import React from "react" +import styled from "styled-components" +import { useDispatch,useSelector } from "react-redux" +import { SignActions } from "../../store/Sign-slice.ts" +import { RootState } from "../../store/index"; + +import {submitStartAndEnd} from "./signUtil.tsx"; +const StyleButton = styled.button` + height: 4vh; + border-radius: 15px; + color: #FFFFFF; + background-color: #FFD12D; + border: none; +` + +const SignFormButton = ({value}:{value:string}) => { + const dispatch = useDispatch(); + let start = useSelector((state:RootState)=>state.sign.startPostion); + let end = useSelector((state:RootState)=>state.sign.endPostion); + const ClickBtn = (event:React.MouseEvent) => { + event.preventDefault(); + if(value==="submit") submitPosition(); + else dispatch(SignActions.initialization(value)); + } + const submitPosition = () => { + if(start.tmX!==-1&&end.tmX!==-1) + submitStartAndEnd(); + } + return ( + + {value} + + ) + +} + + + +export default SignFormButton \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/signSvg/BUS.svg b/Backend/Frontend/creative/src/component/sign-component/signSvg/BUS.svg new file mode 100644 index 0000000..3866ca4 --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/signSvg/BUS.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/signSvg/SUBWAY.svg b/Backend/Frontend/creative/src/component/sign-component/signSvg/SUBWAY.svg new file mode 100644 index 0000000..c2a2ec9 --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/signSvg/SUBWAY.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx b/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx new file mode 100644 index 0000000..c24a143 --- /dev/null +++ b/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx @@ -0,0 +1,6 @@ +import React from "react" +import { api } from "../auth/Api.ts" + +export const submitStartAndEnd = () =>{ + window.location.href = `/#/sign/detail` +} \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaybath/SubwayBathChairInfo.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaybath/SubwayBathChairInfo.tsx index adacdfa..13b36a8 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaybath/SubwayBathChairInfo.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaybath/SubwayBathChairInfo.tsx @@ -4,39 +4,20 @@ import styled from "styled-components"; const StyledBathChair = styled.div` width: 90%; display: flex; - .title { - font-size: 2vw; - margin: 1.8vw; - } .body { - font-size: 1.7vw; + font-size: 1em; margin: 0; margin-bottom: 1vw; } font-family: "Pretendard-Regular"; font-style: normal; font-weight: 600; - @media (max-width: 500px) { - font-size: 4vw; - width: 90%; - height: 80vw; - .title { - font-size: 4vw; - margin: 1.8vw; - } - .body { - font-size: 3vw; - margin: 0; - margin-bottom: 2vw; - } - } `; const SubwayBathchairInfo = (props:any) => { - const {mvContDtl,direction} = props; + const {mvContDtl} = props; return ( -

{direction}

{mvContDtl}

); diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetail.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetail.tsx index 4bb04f0..e78daa7 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetail.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaydetail/SubwayDetail.tsx @@ -9,18 +9,17 @@ interface subDetail { const SubwayDetail = (props:any) => { const {info} = props; const idColor = ["#0052A4", "#00A84D", "#EF7C1C", "#00A5DE", "#996CAC", "#CD7C2F", "#747F00", "#E6186C"]; - // return (
-

{info.lnCd}

-

{info.stNm}

+ {info.lnCd} + {info.stNm}
-

info-images{info.roadNm}

-

교통약자 도우미 전화번호
{info.wNum}

-

지하철역 영문명: {info.eName}

-

지하철역 FR_CODE: {info.fCode}

+ info-images{info.roadNm} + 교통약자 도우미 전화번호
{info.wNum}
+ 지하철역 영문명: {info.eName} + 지하철역 FR_CODE: {info.fCode}
) @@ -29,27 +28,24 @@ const SubwayDetail = (props:any) => { const StyledDetail = styled.div` display:flex; flex-direction:column; -width: 35vw; -height: 80vh; +width: 98vw; +height: 40vh; background-color:white; -margin:0; -border: 4px solid #9255F5; +border: 4px solid #FFD12D; .info-image{ - width: 1.8vw; - height: 1.8vw; + width: 1em; + height: 1em; } .name{ font-family: 'Pretendard-Regular'; display:flex; align-items:center; - width:100%; - height:auto; + width:96%; + height:200%; font-weight: 600; - font-size: 2.1vw; - border-bottom: 4px solid #9255F5; -} -.name p{ - margin-left:26px; + font-size: 1em; + padding-left:4%; + border-bottom: 4px solid #FFD12D; } .line{ display:flex; @@ -57,54 +53,27 @@ border: 4px solid #9255F5; align-items:center; color:#FFFFFF; font-style: normal; + font-size: 100%; font-weight: 600; - font-size: 1.5vw; - width: 48px; - height: 48px; + width: 1.4em; + height: 1.4em; background-color:${props => (props.idColor[props.line - 1])}; - border-radius:200px; + border-radius:20px; } .info{ font-family: 'Pretendard-Regular'; - width:100%; + width:96%; + height: 800%; display:flex; flex-direction:column; font-weight: 600; - font-size: 1.5vw; - padding-left:1vw; + font-size: 100%; + padding-left:4%; + padding-top:4%; } -p{ - display:flex; - justify-content:start; -} - -@media (max-width:500px) { - border: 2px solid #9255F5; - width:99%; - height:80vw; - .info p{ - margin-bottom:1vw; - } - .line{ - width: 8vw; - height: 8vw; - } - .name{ - height:15vw; - font-size:5vw; - } - .name p{ - margin-left:3vw; - } - .info{ - padding-left:3vw; - font-size:5vw; - width:90%; - } - .info-image{ - width: 7vw; - height: 7vw; - } +.info span{ + width:100%; + margin-bottom: 1em; } ` diff --git a/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayButton.tsx b/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayButton.tsx deleted file mode 100644 index 3e9e7c0..0000000 --- a/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayButton.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import React from "react"; -import styled from "styled-components" - -const StyledButton = styled.button` -width: 16%; -height: 100%; -background: #9255F5; -border: 1px solid #9255F5; -.GRASS{ - width:80%; - height:80%; - background: transparent; -} -@media (max-width:500px){ - width:20%; - height:100%; -} - -` - -const SubwayButton = () => { - return ( - GRASS - ) -} - -export default SubwayButton \ No newline at end of file diff --git a/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayForm.tsx b/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayForm.tsx index 385431f..7af2ca4 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayForm.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayForm.tsx @@ -1,5 +1,4 @@ import React from "react"; -import SubwayButton from "./SubwayButton.tsx"; import SubwayInput from "./SubwayInput.tsx"; import styled from "styled-components"; import { useDispatch } from "react-redux"; @@ -9,22 +8,22 @@ import { MapActions } from "../../../store/Map-slice.ts"; const StyledForm = styled.form` display:flex; - width: 34.6vw; - height: 11vh; - border: 4px solid #9255F5; - @media (max-width:500px){ - width: 98vw; - height: 15vw; - } + position: fixed; + z-index: 100; + top: 15vh; + width: 80vw; + height: 1vh; ` const SubwayForm = () => { const dispatch = useDispatch(); + const SubmitSubwayStation = async (value:any) => { await api.get(`/subway/stNm/${value}`) .then(res => { const { data } = res; + dispatch(SubwayActions.addSubwayInfo(data)) dispatch(MapActions.Onsubwaymode()) }).catch(error => { @@ -44,7 +43,6 @@ const SubwayForm = () => { return ( - ) } diff --git a/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayInput.tsx b/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayInput.tsx index 8f77731..20f6055 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayInput.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwayform/SubwayInput.tsx @@ -3,26 +3,16 @@ import styled from "styled-components" const StyledInput = styled.input` -width: 80%; -height: 8.5vh; -padding: 15px; -font-size: 2.5vw; -border:0; -font-family: 'Pretendard-Regular'; -font-weight: 700; -@media (max-width:500px){ - font-family: 'Pretendard-Regular'; - width: 80%; - height: 15vw; - font-size: 6vw; - padding: 1%; -} + width: 100%; + padding: 1em; + font-size: 80%; + font-family: 'Pretendard-Regular'; + font-weight: 700; + border: 0; + border-radius: 30px; ` const SubwayInput = () => { - - - return ( ) diff --git a/Backend/Frontend/creative/src/component/subway-component/subwayinfo/SubwayInfo.tsx b/Backend/Frontend/creative/src/component/subway-component/subwayinfo/SubwayInfo.tsx index 03a3ed0..5231980 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwayinfo/SubwayInfo.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwayinfo/SubwayInfo.tsx @@ -5,17 +5,23 @@ import SubwayBathchairInfo from "../subwaybath/SubwayBathChairInfo.tsx"; const StyledInfo = styled.div` display:flex; flex-direction:column; -width: 720px; -height: 720px; +align-items: center; +width: 98vw; +height: 40vh; background-color:white; -border: 4px solid #9255F5; +border: 4px solid #FFD12D; overflow:auto; - -@media (max-width:500px){ - margin:0; - width: 98%; - height:80vw; - +.head{ + font-size: 1.2em; + font-family: "Pretendard-Regular"; + font-style: normal; + font-weight: 600; + margin-top: 0; +} +.para{ + width: 95%; + border-bottom: 1px solid; + margin-bottom: 10px; } ` @@ -23,15 +29,19 @@ const SubwayInfo = (props:any) => { const {info} = props; return ( - {info.map((element:any) => ( - element.map((node:any) => ( + {info.map((element:any) => { + let {direction,info} = element; + return (
+

{direction}

+ {info.map((node:any)=>( - )) - ))} + /> + ))} +
) + })}
) } diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayItems.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayItems.tsx index 88a4157..bb662a4 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayItems.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayItems.tsx @@ -15,20 +15,20 @@ interface sbitem { } const SubwayItems = (props:any) => { - const {items} = props; - const { stNm, lnNm, stCd } = items const [position, setPosition] = useState(""); - const [color, setColor] = useState(false); + const [color, setColor] = useState("false"); const dispatch = useDispatch() const currentSubway = useSelector((state:RootState) => state.subway.currentSubway) + + const {items} = props; + const { stNm, lnNm, stCd } = items const idColor = ["#0052A4", "#00A84D", "#EF7C1C", "#00A5DE", "#996CAC", "#CD7C2F", "#747F00", "#E6186C"]; + useEffect(() => { - if (currentSubway === stCd) { - setColor(false) - } - else { - setColor(true) - } + if (currentSubway === stCd) + setColor("false") + else + setColor("true") const locationRecive = async () => { await api.get(`/subway/stationInfo/${stCd}/${stNm}`) .then(res => { @@ -40,11 +40,10 @@ const SubwayItems = (props:any) => { }, [currentSubway,stCd,stNm]) const ClickSubway = () => { - if (currentSubway === stCd) { + if (currentSubway === stCd) window.location.href = `/#/subway/detail/${stCd}/${stNm}`; - } else if (currentSubway !== stCd) { - setColor(false) + setColor("false") dispatch(MapActions.positioning(position)) dispatch(MapActions.makerchacking(position)) dispatch(SubwayActions.clickSubway(stCd)) @@ -66,7 +65,7 @@ width:100%; align-items:center; list-style:none; border-bottom: 1px solid #D2D2D2; -background-color:${props => (props.color ? "#FFFFFF" : "#9255F5")}; +background-color:${props => (props.color==="true" ? "#FFFFFF" : "#FFD12D")}; color:black; font-family: 'Pretendard-Regular'; :hover{ @@ -84,10 +83,10 @@ a{ padding-left:20px; font-family: 'Pretendard-Regular'; font-style: normal; - font-weight: ${props => (props.color ? "400" : "700")}; - font-size: 40px; + font-weight: ${props => (props.color==="true" ? "400" : "700")}; + font-size: 1em; line-height: 60px; - color:${props => (props.color ? "#000000" : "#FFFFFF")}; + color:${props => (props.color==="true" ? "#000000" : "#FFFFFF")}; } .line{ color:#FFFFFF; @@ -98,24 +97,13 @@ a{ font-family: 'Pretendard-Regular'; font-style: normal; font-weight: 600; - font-size: 1.5vw; - width: 48px; - height: 48px; + font-size: 1em; + width: 2em; + height: 2em; background-color:${(props:any) => (props.idColor[props.lnNm - 1])}; border-radius:200px; } -@media (max-width:500px){ - height:25%; - .name{ - font-size: 5vw; - } - .line{ - font-size: 3vw; - width: 10vw; - height: 10vw; - } -} ` diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayList.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayList.tsx index a537014..238a560 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayList.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaylist/SubwayList.tsx @@ -10,20 +10,15 @@ display:flex; flex-direction:column; align-items: center; box-sizing: border-box; -width: 35vw; -height: 68vh; -background: #FFFFFF; -border: 4px solid #9255F5; +width: 100%; +max-height:50%; +min-height:50%; padding:0; margin:0; overflow:auto; a{ text-decoration:none; } -@media (max-width:500px) { - width:100%; - height:30vh; -} ` const SubwayList = () => { diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaymenubar/SubwayBar.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaymenubar/SubwayBar.tsx index c528a36..56c6753 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaymenubar/SubwayBar.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaymenubar/SubwayBar.tsx @@ -29,7 +29,7 @@ a{ @media (max-width:500px){ flex-direction: row; - justify-content:space-even; + justify-content:space-evenly; font-size:4vw; margin:0; li{ diff --git a/Backend/Frontend/creative/src/component/subway-component/subwaypanel/SubwayPanel.tsx b/Backend/Frontend/creative/src/component/subway-component/subwaypanel/SubwayPanel.tsx index 3dc79dc..e603008 100644 --- a/Backend/Frontend/creative/src/component/subway-component/subwaypanel/SubwayPanel.tsx +++ b/Backend/Frontend/creative/src/component/subway-component/subwaypanel/SubwayPanel.tsx @@ -10,7 +10,7 @@ width: 19vw; height: 85vh; margin-right: 2vw; font-family: 'GmarketSansMedium'; -background: linear-gradient(270deg, #7C34F3 -44.25%, rgba(146, 85, 245, 0) 222.13%); +background: #FFD12D; font-size: 2.5vw; color: #FFFFFF; @media (max-width:500px) { diff --git a/Backend/Frontend/creative/src/hook/useSignForm.tsx b/Backend/Frontend/creative/src/hook/useSignForm.tsx new file mode 100644 index 0000000..491c776 --- /dev/null +++ b/Backend/Frontend/creative/src/hook/useSignForm.tsx @@ -0,0 +1,27 @@ +import React,{useEffect,useState} from "react" +import { useSelector } from "react-redux"; +import {wrapPromise} from "../promise/warmPromise.ts" +import { api } from "../component/auth/Api.ts"; +import { RootState } from "../store/index"; + + +const useSignForm = () => { + const [signArr,SetSignArr] = useState([""]); + let start = useSelector((state:RootState)=>state.sign.startPostion); + let end = useSelector((state:RootState)=>state.sign.endPostion); + useEffect(() => { + const getbusNsub = async () => { + await api.get(`/navigation/${start.tmY}/${start.tmX}/${end.tmY}/${end.tmX}/busNsub`) + .then(res=>{ + console.log(res.data,"busNsub") + SetSignArr([res.data]) + }) + } + getbusNsub(); + },[start,end]) + return signArr; +} + + + +export default useSignForm; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/BusPage.module.css b/Backend/Frontend/creative/src/page/BusPage.module.css index f2e9fe0..a2cfcdf 100644 --- a/Backend/Frontend/creative/src/page/BusPage.module.css +++ b/Backend/Frontend/creative/src/page/BusPage.module.css @@ -1,14 +1,9 @@ -.main { - display: flex; - justify-content: start; - width: 100vw; -} - .buspage { display: flex; flex-direction: column; align-items: center; - justify-content: space-between; + justify-content: center; + height: 100vh; } .busmain { @@ -20,21 +15,4 @@ display: flex; flex-direction: column; margin-right: 30px; -} - -@media (max-width:500px) { - .main { - flex-direction: column; - } - - .busmain { - flex-direction: column; - margin-top: 0; - height: 100%; - justify-content: space-between; - } - - .buslist { - margin-right: 0; - } } \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/BusPage.tsx b/Backend/Frontend/creative/src/page/BusPage.tsx index 0915413..e9a778c 100644 --- a/Backend/Frontend/creative/src/page/BusPage.tsx +++ b/Backend/Frontend/creative/src/page/BusPage.tsx @@ -1,25 +1,22 @@ import React from "react"; -import Mapping from "../component/map/Mapping.tsx" -import BusForm from "../component/bus-component/busform/BusForm.tsx" -import BusList from "../component/bus-component/buslist/BusList.tsx" +import { useSelector } from "react-redux"; +import Mapping from "../component/map/BusMapping.tsx" import classes from "./BusPage.module.css" import Header from "../component/header/Header.tsx" -import BusPanel from "../component/bus-component/buspanel/BusPanel.tsx" +import MenuBar from "../component/menu/MenuBar.tsx"; +import BusForm from "../component/bus-component/busform/BusForm.tsx" +import BusList from "../component/bus-component/buslist/BusList.tsx" +import { RootState } from "../store/index"; const BusPage = () => { + const busmode = useSelector((state:RootState) => state.map.busmode) return (
-
- -
-
- - -
- -
-
+ + + {busmode&&} +
) } diff --git a/Backend/Frontend/creative/src/page/MainPage.module.css b/Backend/Frontend/creative/src/page/MainPage.module.css index f49d3f2..7bb9266 100644 --- a/Backend/Frontend/creative/src/page/MainPage.module.css +++ b/Backend/Frontend/creative/src/page/MainPage.module.css @@ -5,6 +5,7 @@ body { } .bottom { width: 100%; +<<<<<<< HEAD height: 100vh; } @@ -14,13 +15,38 @@ body { align-items: center; justify-content: center; height: 100vh; +} +.main_detail{ + display: flex; + flex-direction: column; + justify-content: space-evenly; + height: 30vh; +======= + height: 100vh; +} + +.main { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; +>>>>>>> a4564550bd27da525e96b6fc9b5b02b8210532dc animation: fadein 2s; -moz-animation: fadein 2s; - /* Firefox */ -webkit-animation: fadein 2s; - /* Safari and Chrome */ -o-animation: fadein 2s; - /* Opera */ +} +.main_title{ + font-family: 'GmarketSansMedium'; + font-weight: 700; + font-size: 2em; +} +.main_explan{ + display:flex; + text-align:center; + font-family: 'Pretendard-Regular'; + font-size: 1em; } .main_detail{ display: flex; diff --git a/Backend/Frontend/creative/src/page/SIgnDetailPage.tsx b/Backend/Frontend/creative/src/page/SIgnDetailPage.tsx new file mode 100644 index 0000000..e84514c --- /dev/null +++ b/Backend/Frontend/creative/src/page/SIgnDetailPage.tsx @@ -0,0 +1,18 @@ +import React from "react"; +import classes from "./SignDetailPage.module.css" +import Header from "../component/header/Header.tsx" +import MenuBar from "../component/menu/MenuBar.tsx"; +import SignDetail from "../component/sign-component/SignDetail.tsx"; + + +const SignDetailPage = () => { + return ( +
+
+ + +
+ ) +} + +export default SignDetailPage \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/SignDetailPage.module.css b/Backend/Frontend/creative/src/page/SignDetailPage.module.css new file mode 100644 index 0000000..54daa87 --- /dev/null +++ b/Backend/Frontend/creative/src/page/SignDetailPage.module.css @@ -0,0 +1,7 @@ +.signpage { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; +} diff --git a/Backend/Frontend/creative/src/page/SignPage.module.css b/Backend/Frontend/creative/src/page/SignPage.module.css new file mode 100644 index 0000000..54daa87 --- /dev/null +++ b/Backend/Frontend/creative/src/page/SignPage.module.css @@ -0,0 +1,7 @@ +.signpage { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; +} diff --git a/Backend/Frontend/creative/src/page/SignPage.tsx b/Backend/Frontend/creative/src/page/SignPage.tsx new file mode 100644 index 0000000..0fee62f --- /dev/null +++ b/Backend/Frontend/creative/src/page/SignPage.tsx @@ -0,0 +1,20 @@ +import React from "react"; +import Mapping from "../component/map/SignMapping.tsx" +import classes from "./SignPage.module.css" +import Header from "../component/header/Header.tsx" +import MenuBar from "../component/menu/MenuBar.tsx"; +import SignForm from "../component/sign-component/SignForm.tsx"; + + +const SignPage = () => { + return ( +
+
+ + + +
+ ) +} + +export default SignPage \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.module.css index 6c17c2c..2f582c4 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.module.css @@ -1,7 +1,6 @@ .main { - display: flex; - justify-content: start; width: 100vw; + margin-top: 10vh; } .subwaypage { @@ -12,8 +11,8 @@ } .subwayImage { - width: 40vw; - height: 68vh; + width: 100vw; + height: 20vh; } .subwaylist { @@ -23,26 +22,4 @@ .subwaymain { display: flex; margin-top: 20px; -} - -@media (max-width:500px) { - .main { - flex-direction: column; - } - - .subwaymain { - flex-direction: column; - margin-top: 0; - height: 100%; - justify-content: space-between; - } - - .subwaylist { - flex-direction: column; - } - - .subwayImage { - width: 100%; - height: 30vh; - } } \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.tsx index 9c7db47..61c32f2 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.tsx +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayBathchair.tsx @@ -2,19 +2,21 @@ import React from "react"; import classes from "./SubwayBathchair.module.css" import Header from "../../component/header/Header.tsx" import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPanel.tsx" +import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" +import SubwayInfo from "../../component/subway-component/subwayinfo/SubwayInfo.tsx" +import MenuBar from "../../component/menu/MenuBar.tsx"; + import { useParams } from "react-router-dom" import { api } from "../../component/auth/Api.ts" import { useEffect, useState } from "react" import { useDispatch } from "react-redux" import { SubwayActions } from "../../store/Subway-slice.ts" -import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" -import SubwayInfo from "../../component/subway-component/subwayinfo/SubwayInfo.tsx" const SubwayBathchair = () => { const params = useParams(); const [bath, setBath] = useState([]); - const [image, setimage] = useState(""); + const [image, setimage] = useState(""); const dispatch = useDispatch() useEffect(() => { const stCd = params.stCd; @@ -37,22 +39,18 @@ const SubwayBathchair = () => { } getBathChair() }, [dispatch,params.lnCd,params.railCd,params.stCd,params.stNm]) + return (
} /> -
-
- - subwayImage -
-
+ + subwayImage
+
) } - - export default SubwayBathchair diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.module.css index 4bb2a50..a9dead2 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.module.css @@ -1,14 +1,8 @@ -.main { - display: flex; - justify-content: start; - width: 100vw; -} - .subwaypage { display: flex; flex-direction: column; align-items: center; - justify-content: space-between; + justify-content: center; } .subwaylist { @@ -21,20 +15,6 @@ display: flex; margin-top: 20px; } - -@media (max-width:500px) { - .main { - flex-direction: column; - height: 100%; - } - - .subwaymain { - flex-direction: column; - margin-top: 0; - height: 100%; - } - - .subwaylist { - margin-right: 0; - } +.main{ + margin-top: 10vh; } \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.tsx index 22e43a8..92a4c53 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.tsx +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayDetailPage.tsx @@ -1,10 +1,12 @@ import React, { useEffect, useState } from "react" -import Mapping from "../../component/map/Mapping.tsx" + import classes from "./SubwayDetailPage.module.css" import Header from "../../component/header/Header.tsx" import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPanel.tsx" import SubwayDetail from "../../component/subway-component/subwaydetail/SubwayDetail.tsx" import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" +import MenuBar from "../../component/menu/MenuBar.tsx" + import { useDispatch } from "react-redux" import { SubwayActions } from "../../store/Subway-slice.ts" import { api } from "../../component/auth/Api.ts" @@ -23,25 +25,21 @@ const SubwayDetailPage = () => { .then(res => { const { data } = res; const { stationinfo } = data; - console.log(data) setInfo(stationinfo); dispatch(SubwayActions.saveSubway(stationinfo)) }) } getDetail() }, [dispatch,params.stCd,params.stNm]) + return (
- } /> -
-
- -
- -
+ } /> +
+
) } diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.module.css index 6f23be2..9a0f768 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.module.css @@ -1,19 +1,16 @@ .main { - display: flex; - justify-content: start; width: 100vw; + margin: 10vh; } .elevator { - width: 60vw; - height: 75vh; + width: 100vw; } .subwaypage { display: flex; flex-direction: column; align-items: center; - justify-content: space-between; } .subwaylist { @@ -25,31 +22,4 @@ .subwaymain { display: flex; margin-top: 20px; -} - -@media (max-width:500px) { - .main { - flex-direction: column; - } - - .subwaylist { - margin: 0; - } - - .elevator { - width: 100%; - height: 40vh; - } - - .subwaymain { - flex-direction: column; - margin-top: 0; - height: 100%; - justify-content: space-between; - } - - - .subwaylist { - margin-right: 0; - } } \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.tsx index 6f5ddf3..43f7837 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.tsx +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayElevator.tsx @@ -3,6 +3,8 @@ import classes from "./SubwayElevator.module.css" import Header from "../../component/header/Header.tsx" import SubwayBar from "../../component/subway-component/subwaymenubar/SubwayBar.tsx" import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPanel.tsx" +import MenuBar from "../../component/menu/MenuBar.tsx"; + import { useParams } from "react-router-dom" import { api } from "../../component/auth/Api.ts" import { useEffect, useState } from "react" @@ -16,7 +18,7 @@ interface subEle { const SubwayElevator = () => { const params = useParams(); const dispatch = useDispatch(); - const [ElePos, setElePos] = useState([]); + const [ElePos, setElePos] = useState([{imgPath:""}]); useEffect(() => { const stCd = params.stCd; const stNm = params.stNm; @@ -32,17 +34,16 @@ const SubwayElevator = () => { } getBathChair() }, [dispatch, params.lnCd,params.railCd,params.stCd,params.stNm]) + return (
} /> - elevator + elevator
+
) } - - - export default SubwayElevator diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css index 2b3d8ee..134d08d 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css @@ -1,14 +1,9 @@ -.main { - display: flex; - justify-content: start; - width: 100vw; -} - .subwaypage { display: flex; flex-direction: column; align-items: center; - justify-content: space-between; + justify-content: center; + height: 100vh; } .subwaylist { @@ -20,22 +15,4 @@ .subwaymain { display: flex; margin-top: 20px; -} - -@media (max-width:500px) { - .main { - flex-direction: column; - height: 100%; - } - - .subwaymain { - flex-direction: column; - margin-top: 0; - height: 100%; - justify-content: space-between; - } - - .subwaylist { - margin-right: 0; - } } \ No newline at end of file diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.tsx b/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.tsx index 1b0567f..473620a 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.tsx +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.tsx @@ -1,25 +1,24 @@ import React from "react"; -import Mapping from "../../component/map/Mapping.tsx" +import { useSelector } from "react-redux"; + +import Mapping from "../../component/map/SubwayMapping.tsx" import SubwayForm from "../../component/subway-component/subwayform/SubwayForm.tsx" import SubwayList from "../../component/subway-component/subwaylist/SubwayList.tsx" -import classes from "./SubwayPage.module.css" import Header from "../../component/header/Header.tsx" -import SubwayPanel from "../../component/subway-component/subwaypanel/SubwayPanel.tsx" +import MenuBar from "../../component/menu/MenuBar.tsx"; +import { RootState } from "../../store/index"; + +import classes from "./SubwayPage.module.css" const SubwayPage = () => { + const subwaymode = useSelector((state:RootState) => state.map.subwaymode) return (
-
- -
-
- - -
- -
-
+ + + {subwaymode&&} +
) } diff --git a/Backend/Frontend/creative/src/promise/warmPromise.ts b/Backend/Frontend/creative/src/promise/warmPromise.ts new file mode 100644 index 0000000..8ffef53 --- /dev/null +++ b/Backend/Frontend/creative/src/promise/warmPromise.ts @@ -0,0 +1,26 @@ +export const wrapPromise = (promise:Promise) => { + //promise를 던지기 위한 함수 + let status = "pending"; + let result:any; + let suspend = promise.then( + (res) => { + status = "success"; + result = res; + }, + (err) => { + status = "error"; + result = err; + } + ); + return { + read() { + if (status === "pending") { + throw suspend; + } else if (status === "error") { + throw result; + } else if (status === "success") { + return result; + } + }, + }; + }; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/store/Map-slice.ts b/Backend/Frontend/creative/src/store/Map-slice.ts index 6747c41..1768bf6 100644 --- a/Backend/Frontend/creative/src/store/Map-slice.ts +++ b/Backend/Frontend/creative/src/store/Map-slice.ts @@ -4,8 +4,8 @@ const MapSlice = createSlice({ name: "Map", initialState: { position: { - tmY: 37.55068403524657, - tmX: 127.07411251036736 + tmY: 0, + tmX: 0 }, marker: [], busmode: false, @@ -21,8 +21,8 @@ const MapSlice = createSlice({ }, initialization(state) { state.position = { - tmY: 37.55068403524657, - tmX: 127.07411251036736 + tmY: 0, + tmX: 0 }; state.marker = []; state.busmode = false; @@ -35,7 +35,7 @@ const MapSlice = createSlice({ Onsubwaymode(state) { state.busmode = false; state.subwaymode = true; - } + }, } }) diff --git a/Backend/Frontend/creative/src/store/Sign-slice.ts b/Backend/Frontend/creative/src/store/Sign-slice.ts new file mode 100644 index 0000000..79cb80c --- /dev/null +++ b/Backend/Frontend/creative/src/store/Sign-slice.ts @@ -0,0 +1,33 @@ +import { createSlice } from "@reduxjs/toolkit"; + +const SignSlice = createSlice({ + name: "Sign", + initialState: { + State:"", + startPostion:{ + tmX:-1, + tmY:-1 + }, + endPostion:{ + tmX:-1, + tmY:-1 + } + }, + reducers: { + initialization(state,action){ + state.State = action.payload + }, + + initializationStart(state,action){ + state.startPostion.tmX = action.payload.Ma + state.startPostion.tmY = action.payload.La + }, + initializationEnd(state,action){ + state.endPostion.tmX = action.payload.Ma + state.endPostion.tmY = action.payload.La + } + } +}) + +export const SignActions = SignSlice.actions; +export default SignSlice.reducer; \ No newline at end of file diff --git a/Backend/Frontend/creative/src/store/index.ts b/Backend/Frontend/creative/src/store/index.ts index 6811e06..0531ae8 100644 --- a/Backend/Frontend/creative/src/store/index.ts +++ b/Backend/Frontend/creative/src/store/index.ts @@ -1,17 +1,23 @@ -import { configureStore } from "@reduxjs/toolkit" +import { configureStore, getDefaultMiddleware } from "@reduxjs/toolkit" import BusReducer from "./Bus-slice.ts"; import MapReducer from "./Map-slice.ts" import SubwayReducer from "./Subway-slice.ts" +import SignReducer from "./Sign-slice.ts"; + import { combineReducers } from "@reduxjs/toolkit"; const reducer = combineReducers({ - bus: BusReducer, map: MapReducer, subway: SubwayReducer + bus: BusReducer, map: MapReducer, subway: SubwayReducer, sign:SignReducer }) const store = configureStore({ - reducer: reducer + reducer: reducer, + middleware: (getDefaultMiddleware) => + getDefaultMiddleware({ + serializableCheck:false, + }) });