Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion client/src/components/MapComponent/MapComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import FitBounds from "./FitBounds";
import { InstructionsI, SummaryI } from "../../Types/Route";
import SosButton from "../../pages/journeyPage/SosButton";


export interface MapComponentProps {
latitude: number | null; // User's latitude
longitude: number | null; // User's longitude
Expand Down Expand Up @@ -122,7 +123,7 @@ const MapComponent: React.FC<MapComponentProps> = ({
<Polyline
key={`sidewalk-${index}`}
positions={sidewalk.geometry.map(({ lat, lon }) => latLng(lat, lon))}
color="green"
color="pink"
/>
))}

Expand Down
2 changes: 2 additions & 0 deletions client/src/hooks/useSocket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ export const useSocket = ({ password }: { password?: string }) => {
}
}


function sendPosition (position: PositionI) {
if (!position) {
console.warn("No position to send!");

return;
}

Expand Down
18 changes: 11 additions & 7 deletions client/src/pages/journeyPage/JourneyPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCallback, useEffect, useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import MapComponent from "../../components/MapComponent/MapComponent";
import ProgressBar from "./ProgressBar";
import SosButton from "./SosButton";

import AlarmButton from "./AlarmButton";
import WeatherInfo from "./WeatherInfo";
import { PositionI, usePosition } from "../../hooks/usePosition";
Expand All @@ -19,6 +19,8 @@ import { useSocket } from "../../hooks/useSocket";
import { TbNavigationCancel } from "react-icons/tb";
import Footer from "../../components/Footer"
import { MdEmergencyShare } from "react-icons/md";
import { MdOutlineAltRoute } from "react-icons/md";




Expand Down Expand Up @@ -101,10 +103,7 @@ const JourneyPage: React.FC = () => {



const handleSOSActivated = () => {
console.log('SOS button activated on Journey Page!');

};


// Handle rerouting if the user deviates from the route
const handleReroute = useCallback(async () => {
Expand Down Expand Up @@ -260,7 +259,7 @@ useEffect(() => {
< ProgressBar progress={rerouted ? 75 : 50} />

<div className="features-container" >
<SosButton onSOSActivated={handleSOSActivated} />

< AlarmButton />
<MdEmergencyShare
onClick={handleShare}
Expand Down Expand Up @@ -299,7 +298,12 @@ useEffect(() => {
}
</select>
</div>
<button onClick={handleReroute}>REROUTE!</button>
<MdOutlineAltRoute className="reroute" onClick={handleReroute} style={{
fontSize: "40px",
color: "#EBEBEB",
cursor: "pointer",
transition: "transform 0.2s ease",
}} title="Cancel Journey" />
</div>

< WeatherInfo />
Expand Down
Loading