forked from intrig-unicamp/paths-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#13: Refactors map to use session instead of files
- Loading branch information
1 parent
67f947b
commit ab42d2a
Showing
12 changed files
with
146 additions
and
156 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { Grid, List, Paper, Typography } from "@mui/material"; | ||
import { Fragment, FunctionComponent } from "react"; | ||
import { useAppSelector } from "../../config/hooks"; | ||
import { selectSession } from "../../features/sessions/slice"; | ||
import CoordinatesList from "../CoordinatesList/CoordinatesList"; | ||
import Map from "../Map/Map"; | ||
|
||
const MapContainer: FunctionComponent = () => { | ||
const session = useAppSelector(selectSession); | ||
|
||
return ( | ||
<Grid container spacing={1} sx={{ my: 2 }}> | ||
<Grid item xs={8}> | ||
<Paper> | ||
<Map entities={session?.entities} /> | ||
</Paper> | ||
</Grid> | ||
<Grid item xs={4}> | ||
{session?.entities?.length === 0 ? ( | ||
<Typography component="h3" variant="h3" sx={{ m: 1 }}> | ||
No entities found. | ||
</Typography> | ||
) : ( | ||
<Fragment> | ||
<Typography | ||
component="h2" | ||
variant="h2" | ||
sx={{ m: 1, fontWeight: "bold" }} | ||
> | ||
Entities list | ||
</Typography> | ||
<Paper> | ||
<List> | ||
{session?.entities?.map((entity, fileIndex) => ( | ||
<CoordinatesList entity={entity} key={`file-${fileIndex}`} /> | ||
))} | ||
</List> | ||
</Paper> | ||
</Fragment> | ||
)} | ||
</Grid> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default MapContainer; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.