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.
dialog to display an observation selection based on the floating dialog
- Loading branch information
1 parent
f181059
commit ba79c39
Showing
1 changed file
with
33 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React, {Fragment} from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import BaseFloatingDialog from "@utils/base-floating-dialog"; | ||
|
||
// define the properties of this component | ||
ObservationDialog.propTypes = { | ||
obs_data: PropTypes.object | ||
}; | ||
|
||
export default function ObservationDialog(obs_data) { | ||
// TODO: the url is put in here but it will eventually | ||
// return a graph using data from this url | ||
const graphObj = (url) => { | ||
return ( | ||
<Fragment> | ||
<div> | ||
{url} | ||
</div> | ||
</Fragment> | ||
); | ||
}; | ||
|
||
// create an object for the base dialog | ||
const floaterArgs = {title: obs_data.obs.station_name, description: obs_data.obs.location_name, openDialogImmediately:true, "dialogObject": {...graphObj(obs_data.obs.csvurl)}}; | ||
|
||
// render the dialog. | ||
// the key here will be used to remove the dialog from the selected observation list when the dialog is closed | ||
return ( | ||
<Fragment> | ||
<BaseFloatingDialog {...floaterArgs} /> | ||
</Fragment> | ||
); | ||
}; |