-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ebubeker
committed
Nov 14, 2023
1 parent
c282ead
commit 5123330
Showing
17 changed files
with
1,054 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
import React, { useState } from "react"; | ||
import Container from "@/components/map/panels/Container"; | ||
import { Box, Button, useTheme } from "@mui/material"; | ||
import IsochroneSettings from "@/components/map/panels/isochrone/IsochroneSettings"; | ||
import StartingPoint from "@/components/map/panels/isochrone/StartingPoint"; | ||
import { useTranslation } from "@/i18n/client"; | ||
import SaveResult from "@/components/map/panels/toolbox/tools/SaveResult"; | ||
|
||
import type { MapSidebarItem } from "@/types/map/sidebar"; | ||
import type { StartingPointType } from "@/types/map/isochrone"; | ||
|
||
type IsochroneProps = { | ||
setActiveRight: (item: MapSidebarItem | undefined) => void; | ||
}; | ||
|
||
type RoutingTypes = | ||
| "bus" | ||
| "tram" | ||
| "rail" | ||
| "subway" | ||
| "ferry" | ||
| "cable_car" | ||
| "gondola" | ||
| "funicular" | ||
| "walk" | ||
| "bicycle" | ||
| "car"; | ||
|
||
const Isochrone = (props: IsochroneProps) => { | ||
// Isochrone Settings states | ||
const [routing, setRouting] = useState<RoutingTypes | undefined>(undefined); | ||
const [speed, setSpeed] = useState<number | undefined>(undefined); | ||
const [distance, setDistance] = useState<number | undefined>(undefined); | ||
const [travelTime, setTravelTime] = useState<number | undefined>(undefined); | ||
const [steps, setSteps] = useState<number | undefined>(undefined); | ||
const [outputName, setOutputName] = useState<string | undefined>(undefined); | ||
const [folderSaveID, setFolderSaveID] = useState<string | undefined>( | ||
undefined, | ||
); | ||
|
||
// Sarting point states | ||
const [startingType, setStartingType] = useState< | ||
StartingPointType | undefined | ||
>(undefined); | ||
const [startingPoint, setStartingPoint] = useState<string | undefined>( | ||
undefined, | ||
); | ||
|
||
const theme = useTheme(); | ||
const { t } = useTranslation("maps"); | ||
const { setActiveRight } = props; | ||
|
||
return ( | ||
<Container | ||
title="Legend" | ||
close={setActiveRight} | ||
direction="left" | ||
body={ | ||
<Box | ||
display="flex" | ||
flexDirection="column" | ||
justifyContent="space-between" | ||
sx={{ height: "100%" }} | ||
> | ||
<Box sx={{ maxHeight: "95%", overflow: "scroll" }}> | ||
<IsochroneSettings | ||
routing={routing} | ||
setRouting={setRouting} | ||
distance={distance} | ||
setDistance={setDistance} | ||
speed={speed} | ||
setSpeed={setSpeed} | ||
travelTime={travelTime} | ||
setTravelTime={setTravelTime} | ||
steps={steps} | ||
setSteps={setSteps} | ||
/> | ||
<StartingPoint | ||
startingType={startingType} | ||
setStartingType={setStartingType} | ||
startingPoint={startingPoint} | ||
setStartingPoint={setStartingPoint} | ||
/> | ||
<SaveResult | ||
outputName={outputName} | ||
setOutputName={setOutputName} | ||
folderSaveId={folderSaveID} | ||
setFolderSaveID={setFolderSaveID} | ||
/> | ||
</Box> | ||
<Box | ||
sx={{ | ||
display: "flex", | ||
gap: theme.spacing(2), | ||
alignItems: "center", | ||
}} | ||
> | ||
<Button | ||
variant="outlined" | ||
sx={{ flexGrow: "1" }} | ||
// onClick={handleReset} | ||
> | ||
{t("panels.tools.reset")} | ||
</Button> | ||
<Button | ||
sx={{ flexGrow: "1" }} | ||
// onClick={handleRun} | ||
> | ||
{t("panels.tools.run")} | ||
</Button> | ||
</Box> | ||
</Box> | ||
} | ||
/> | ||
); | ||
}; | ||
|
||
export default Isochrone; |
Oops, something went wrong.