text: // Component model: https://v4-7-2.material-ui.com/components/dialogs/#form-dialogs
  
  import React, { useContext } from 'react';
  import Button from '@material-ui/core/Button';
  import TextField from '@material-ui/core/TextField';
  import Dialog from '@material-ui/core/Dialog';
  import DialogActions from '@material-ui/core/DialogActions';
  import DialogContent from '@material-ui/core/DialogContent';
  import DialogContentText from '@material-ui/core/DialogContentText';
  import DialogTitle from '@material-ui/core/DialogTitle';
  
  // Context
  // Source: https://www.digitalocean.com/community/tutorials/react-usecontext
  import { DisplayContext } from '../../../../layouts/ObjectViewLayout/index';
  
  export default function EmailDialog() {
    
    // Use the parent context.
    // Source: https://www.digitalocean.com/community/tutorials/react-usecontext
  
    // As of 1/29/21, there is a problem in React with this function call.
    // Source: https://stackoverflow.com/questions/62564671/using-usecontext-in-react-doesnt-give-me-the-expect-data
  
    // Pull the state and change handler from the context.
    const { 
      emailObject, handleClickOpen, handleClose
    } = useContext(DisplayContext);
  
    return (
      <div>
        <Button variant="outlined" color="primary" onClick={handleClickOpen}>
          Open form dialog
        </Button>
        <Dialog open={emailObject} onClose={handleClose} aria-labelledby="form-dialog-title">
          <DialogTitle id="form-dialog-title">Subscribe</DialogTitle>
          <DialogContent>
            <DialogContentText>
              To subscribe to this website, please enter your email address here. We will send updates
              occasionally.
            </DialogContentText>
            <TextField
              autoFocus
              margin="dense"
              id="name"
              label="Email Address"
              type="email"
              fullWidth
            />
          </DialogContent>
          <DialogActions>
            <Button onClick={handleClose} color="primary">
              Cancel
            </Button>
            <Button onClick={handleClose} color="primary">
              Subscribe
            </Button>
          </DialogActions>
        </Dialog>
      </div>
    );
  }