mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add websocket handling for selected flights.
This commit is contained in:
@@ -3,14 +3,25 @@ import { Polyline } from "react-leaflet";
|
||||
|
||||
const BLUE_PATH = "#0084ff";
|
||||
const RED_PATH = "#c85050";
|
||||
const SELECTED_PATH = "#ffff00";
|
||||
|
||||
interface FlightPlanProps {
|
||||
flight: Flight;
|
||||
selected: boolean;
|
||||
}
|
||||
|
||||
const pathColor = (props: FlightPlanProps) => {
|
||||
if (props.selected) {
|
||||
return SELECTED_PATH;
|
||||
} else if (props.flight.blue) {
|
||||
return BLUE_PATH;
|
||||
} else {
|
||||
return RED_PATH;
|
||||
}
|
||||
};
|
||||
|
||||
function FlightPlanPath(props: FlightPlanProps) {
|
||||
const color = props.flight.blue ? BLUE_PATH : RED_PATH;
|
||||
const color = pathColor(props);
|
||||
const waypoints = props.flight.waypoints;
|
||||
if (waypoints == null) {
|
||||
return <></>;
|
||||
|
||||
Reference in New Issue
Block a user