Kimberly-Hart / East-Barley

1 stars 1 forks source link

Age Verfication #69

Closed aclai4067 closed 4 years ago

aclai4067 commented 4 years ago

Developer Story

As a user, I want to enter my age to verify if I am 21+

AC

WHEN the page loads THEN pop a model asking for the visitors date of birth AND update the over21 state to reflect the users age (this will be used in the routes ticket to keep under 21 users from visiting pages selling alcohol)

Dev Notes

this code has been adjusted to open on load and will not close on esc or dimmer click, however, the modal content still needs to be filled in & we need to add a conditional to keep the modal from popping once this questions has been answered (something like If AgeVerificationComplete setState Open: False)

import React, { Component } from 'react'
import { Button, Modal } from 'semantic-ui-react'

class ModalExampleCloseConfig extends Component {
  state = { open: true }

  closeConfigShow = (closeOnEscape, closeOnDimmerClick) => () => {
    this.setState({ closeOnEscape: false, closeOnDimmerClick: false, open: true })
  }

  close = () => this.setState({ open: false })

  render() {
    const { open, closeOnEscape, closeOnDimmerClick } = this.state

    return (
      <div>
\        <Modal
          open={open}
          closeOnEscape={closeOnEscape}
          closeOnDimmerClick={closeOnDimmerClick}
        >
          <Modal.Header>Delete Your Account</Modal.Header>
          <Modal.Content>
            <p>Are you sure you want to delete your account</p>
          </Modal.Content>
          <Modal.Actions>
            <Button onClick={this.close} negative>
              No
            </Button>
            <Button
              onClick={this.close}
              positive
              labelPosition='right'
              icon='checkmark'
              content='Yes'
            />
          </Modal.Actions>
        </Modal>
      </div>
    )
  }
}

export default ModalExampleCloseConfig

Updates

*