generated from RENCI/react-starter
-
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.
adding the rendering of the items in the selected observation list
- Loading branch information
1 parent
73c13bb
commit ffe6cc9
Showing
1 changed file
with
18 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
import React, { Fragment } from 'react'; | ||
import { Map } from '@components/map'; | ||
import { Sidebar } from '@components/sidebar'; | ||
import ObservationDialog from "@components/map/observation-dialog"; | ||
import { useLayers } from '@context'; | ||
|
||
export const App = () => { | ||
return ( | ||
// install the selected observation list from the layer context | ||
const { | ||
selectedObservations | ||
} = useLayers(); | ||
|
||
return ( | ||
<Fragment> | ||
<Map/> | ||
<Sidebar /> | ||
</Fragment> | ||
); | ||
{ | ||
// for each observation selected | ||
selectedObservations.map (function (obs) { | ||
// render the observation | ||
return <ObservationDialog key={obs.station_name} obs={obs} />; | ||
}) | ||
} | ||
<Map /> | ||
</Fragment> | ||
); | ||
}; |