diff --git a/package-lock.json b/package-lock.json index cbfb01b..a970ab5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "base-project", - "version": "2.1.5", + "version": "2.1.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "base-project", - "version": "2.1.5", + "version": "2.1.6", "dependencies": { "@turf/turf": "^6.5.0", "axios": "^1.1.3", diff --git a/package.json b/package.json index ffff4b2..8b8649b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "base-project", "private": true, - "version": "2.1.5", + "version": "2.1.6", "type": "module", "scripts": { "dev": "vite", diff --git a/src/components/Header/Header.jsx b/src/components/Header/Header.jsx index 910937d..3d65bae 100644 --- a/src/components/Header/Header.jsx +++ b/src/components/Header/Header.jsx @@ -6,13 +6,16 @@ import styles from './styles.module.scss' import { useContext, useEffect, useState} from 'react' import { CodeContext } from '../../hooks/getCode' import { TripContext } from '../../hooks/getTrips' +import { ShapeContext } from '../../hooks/getShape' import { useNavigate } from 'react-router-dom' import { ThemeContext } from '../../hooks/getTheme' +import { RoutesContext } from '../../hooks/getRoutes' export function Header(props) { let navigate = useNavigate() const { code, setCode } = useContext(CodeContext) const { setTrip } = useContext(TripContext) + const {setPoints} = useContext(ShapeContext) const {theme} = useContext(ThemeContext) const [newCode, setNewCode] = useState("") const [value, setValue] = useState('') @@ -21,6 +24,7 @@ export function Header(props) { setTrip('') setCode("") navigate('/') + setPoints("") } @@ -32,6 +36,7 @@ export function Header(props) { setNewCode(event.target.value) setTrip('') setValue() + setPoints("") } diff --git a/src/components/SequenceCard/SequenceCard.jsx b/src/components/SequenceCard/SequenceCard.jsx index edebe46..e953db3 100644 --- a/src/components/SequenceCard/SequenceCard.jsx +++ b/src/components/SequenceCard/SequenceCard.jsx @@ -7,6 +7,7 @@ import { Oval } from 'react-loader-spinner' import { RoutesContext } from '../../hooks/getRoutes' import { GrClose } from 'react-icons/gr' import { ThemeContext } from '../../hooks/getTheme' +import { ShapeContext } from '../../hooks/getShape' export function SequenceCard() { @@ -14,13 +15,19 @@ export function SequenceCard() { const { setTrip, sequenceInfo, stopInfo } = useContext(TripContext) const {stopId} = useContext(RoutesContext) const {theme} = useContext(ThemeContext) + const { setPoints } = useContext(ShapeContext) + function clearMapInfo() { + setTrip('') + setPoints('') + } + return ( <>
-