Reorganize React project structure.

Whatever I was doing was getting out of control :)
This commit is contained in:
Dan Albert
2022-03-01 00:48:08 -08:00
parent 406a64ae3f
commit 6ff9208d46
19 changed files with 67 additions and 66 deletions

View File

@@ -0,0 +1,33 @@
import { Flight } from "../../api/flight";
import { Polyline } from "react-leaflet";
const BLUE_PATH = "#0084ff";
const RED_PATH = "#c85050";
interface FlightPlanProps {
flight: Flight;
selected: boolean;
}
function FlightPlanPath(props: FlightPlanProps) {
const color = props.flight.blue ? BLUE_PATH : RED_PATH;
const waypoints = props.flight.waypoints;
if (waypoints == null) {
return <></>;
}
const points = waypoints.map((waypoint) => waypoint.position);
return (
<Polyline
positions={points}
pathOptions={{ color: color, interactive: false }}
/>
);
}
export default function FlightPlan(props: FlightPlanProps) {
return (
<>
<FlightPlanPath {...props} />
</>
);
}

View File

@@ -0,0 +1 @@
export { default } from "./FlightPlan";