extract overlay class name into constant

pull/1537/head
Jade McGough 2017-05-30 11:16:34 -07:00
parent 3bd9c3b85c
commit f716ef56ad
3 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import React, {Component, PropTypes} from 'react'
import DatabaseDropdown from 'shared/components/DatabaseDropdown'
import OnClickOutside from 'shared/components/OnClickOutside'
import {OVERLAY_CLASS} from 'shared/constants'
class WriteDataForm extends Component {
constructor(props) {
@ -24,7 +25,7 @@ class WriteDataForm extends Component {
handleClickOutside(e) {
// guard against clicking to close error notification
if (e.target.className === 'overlay-technology') {
if (e.target.className === OVERLAY_CLASS) {
const {onClose} = this.props
onClose()
}

View File

@ -1,7 +1,9 @@
import React, {PropTypes} from 'react'
import {OVERLAY_CLASS} from 'shared/constants'
const OverlayTechnologies = ({children}) => (
<div className="overlay-technology">{children}</div>
<div className={OVERLAY_CLASS}>{children}</div>
)
const {node} = PropTypes

View File

@ -399,3 +399,5 @@ export const AUTOREFRESH_DEFAULT = 15000 // in milliseconds
export const GRAPH = 'graph'
export const TABLE = 'table'
export const VIS_VIEWS = [GRAPH, TABLE]
export const OVERLAY_CLASS = 'overlay-technology'