Skip to content

Commit

Permalink
adding the rendering of the items in the selected observation list
Browse files Browse the repository at this point in the history
  • Loading branch information
PhillipsOwen committed May 3, 2024
1 parent 73c13bb commit ffe6cc9
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/app.js
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>
);
};

0 comments on commit ffe6cc9

Please sign in to comment.