diff --git a/Backend/Frontend/creative/src/App.tsx b/Backend/Frontend/creative/src/App.tsx index 19d6751..abd64f7 100644 --- a/Backend/Frontend/creative/src/App.tsx +++ b/Backend/Frontend/creative/src/App.tsx @@ -25,7 +25,7 @@ function App() { }/> }/> }/> - }/> + }/> ); diff --git a/Backend/Frontend/creative/src/component/map/Mapping.module.css b/Backend/Frontend/creative/src/component/map/Mapping.module.css index bb27f82..488641d 100644 --- a/Backend/Frontend/creative/src/component/map/Mapping.module.css +++ b/Backend/Frontend/creative/src/component/map/Mapping.module.css @@ -1,4 +1,4 @@ .busmap, .subwaymap, .signmap { width: 100vw; - height: 80vh; + height: 85vh; } diff --git a/Backend/Frontend/creative/src/component/sign-component/SignDetail.tsx b/Backend/Frontend/creative/src/component/sign-component/SignDetail.tsx index 51fe51b..daa6ac6 100644 --- a/Backend/Frontend/creative/src/component/sign-component/SignDetail.tsx +++ b/Backend/Frontend/creative/src/component/sign-component/SignDetail.tsx @@ -19,8 +19,6 @@ const StyledSignDetail = styled.main` } ` - -//그래프에 필요한것 1. type 2. 시간을 준다. const SignDetail = () => { const arr = useSignForm(); return ( diff --git a/Backend/Frontend/creative/src/component/sign-component/SignFormButton.tsx b/Backend/Frontend/creative/src/component/sign-component/SignFormButton.tsx index e1b33b2..3467ddb 100644 --- a/Backend/Frontend/creative/src/component/sign-component/SignFormButton.tsx +++ b/Backend/Frontend/creative/src/component/sign-component/SignFormButton.tsx @@ -17,15 +17,18 @@ 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(); + submitStartAndEnd(start,end); } + return ( {value} diff --git a/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx b/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx index c24a143..701fd52 100644 --- a/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx +++ b/Backend/Frontend/creative/src/component/sign-component/signUtil.tsx @@ -1,6 +1,12 @@ import React from "react" import { api } from "../auth/Api.ts" -export const submitStartAndEnd = () =>{ - window.location.href = `/#/sign/detail` +interface coordinate { + tmX:number, + tmY:number +} + + +export const submitStartAndEnd = (start:coordinate,end:coordinate) =>{ + window.location.href = `/#/sign/detail/${start.tmY}/${start.tmX}/${end.tmY}/${end.tmX}` } \ No newline at end of file diff --git a/Backend/Frontend/creative/src/hook/useSignForm.tsx b/Backend/Frontend/creative/src/hook/useSignForm.tsx index 491c776..81a6041 100644 --- a/Backend/Frontend/creative/src/hook/useSignForm.tsx +++ b/Backend/Frontend/creative/src/hook/useSignForm.tsx @@ -1,24 +1,28 @@ import React,{useEffect,useState} from "react" -import { useSelector } from "react-redux"; -import {wrapPromise} from "../promise/warmPromise.ts" +import { useParams } from "react-router-dom"; + import { api } from "../component/auth/Api.ts"; -import { RootState } from "../store/index"; const useSignForm = () => { + const param = useParams(); const [signArr,SetSignArr] = useState([""]); - let start = useSelector((state:RootState)=>state.sign.startPostion); - let end = useSelector((state:RootState)=>state.sign.endPostion); useEffect(() => { + const sTmX = param.sTmX; + const sTmY = param.sTmY; + const eTmX = param.eTmX; + const eTmY = param.eTmY; const getbusNsub = async () => { - await api.get(`/navigation/${start.tmY}/${start.tmX}/${end.tmY}/${end.tmX}/busNsub`) + await api.get(`/navigation/${sTmY}/${sTmX}/${eTmY}/${eTmX}/busNsub`) .then(res=>{ - console.log(res.data,"busNsub") SetSignArr([res.data]) + console.log(res.data) + }).catch(error=>{ + console.log(error) }) } getbusNsub(); - },[start,end]) + },[param]) return signArr; } diff --git a/Backend/Frontend/creative/src/page/BusPage.module.css b/Backend/Frontend/creative/src/page/BusPage.module.css index 842c67e..bdb3012 100644 --- a/Backend/Frontend/creative/src/page/BusPage.module.css +++ b/Backend/Frontend/creative/src/page/BusPage.module.css @@ -1,7 +1,6 @@ .buspage { display: flex; flex-direction: column; - align-items: center; - justify-content: center; + justify-content: start; height: 100vh; } diff --git a/Backend/Frontend/creative/src/page/SignPage.module.css b/Backend/Frontend/creative/src/page/SignPage.module.css index 54daa87..af3af6f 100644 --- a/Backend/Frontend/creative/src/page/SignPage.module.css +++ b/Backend/Frontend/creative/src/page/SignPage.module.css @@ -1,7 +1,6 @@ .signpage { display: flex; flex-direction: column; - align-items: center; - justify-content: center; + justify-content: start; height: 100vh; } diff --git a/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css b/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css index 70b13a9..2267e12 100644 --- a/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css +++ b/Backend/Frontend/creative/src/page/subwaypage/SubwayPage.module.css @@ -1,7 +1,6 @@ .subwaypage { display: flex; flex-direction: column; - align-items: center; - justify-content: center; + justify-content: start; height: 100vh; } \ No newline at end of file