Fix type error with show overlay
parent
a9e734daf7
commit
49c67249a0
|
@ -1,6 +1,5 @@
|
|||
import React, {Component} from 'react'
|
||||
import {connect} from 'react-redux'
|
||||
import {bindActionCreators} from 'redux'
|
||||
|
||||
import Authorized, {EDITOR_ROLE} from 'src/auth/Authorized'
|
||||
|
||||
|
@ -10,24 +9,19 @@ import SearchBar from 'src/hosts/components/SearchBar'
|
|||
import FancyScrollbar from 'src/shared/components/FancyScrollbar'
|
||||
import {ErrorHandling} from 'src/shared/decorators/errors'
|
||||
import {Dashboard} from 'src/types/dashboard'
|
||||
import {showOverlay} from 'src/shared/actions/overlayTechnology'
|
||||
import {
|
||||
showOverlay as showOverlayAction,
|
||||
ShowOverlay,
|
||||
} from 'src/shared/actions/overlayTechnology'
|
||||
import {OverlayContext} from 'src/shared/components/OverlayTechnology'
|
||||
|
||||
interface OverlayOptions {
|
||||
dismissOnClickOutside?: boolean
|
||||
dismissOnEscape?: boolean
|
||||
}
|
||||
|
||||
interface Props {
|
||||
dashboards: Dashboard[]
|
||||
onDeleteDashboard: () => void
|
||||
onCreateDashboard: () => void
|
||||
onCloneDashboard: () => void
|
||||
<<<<<<< HEAD
|
||||
onExportDashboard: () => void
|
||||
=======
|
||||
handleShowOverlay: (overlay: React.Component, options: OverlayOptions) => void
|
||||
>>>>>>> Introduce ImportDashboardOverlay component
|
||||
showOverlay: ShowOverlay
|
||||
dashboardLink: string
|
||||
}
|
||||
|
||||
|
@ -135,13 +129,13 @@ class DashboardsPageContents extends Component<Props, State> {
|
|||
}
|
||||
|
||||
private showImportOverlay = (): void => {
|
||||
const {handleShowOverlay} = this.props
|
||||
const {showOverlay} = this.props
|
||||
const options = {
|
||||
dismissOnClickOutside: false,
|
||||
dismissOnEscape: false,
|
||||
}
|
||||
|
||||
handleShowOverlay(
|
||||
showOverlay(
|
||||
<OverlayContext.Consumer>
|
||||
{({onDismissOverlay}) => (
|
||||
<ImportDashboardOverlay onDismissOverlay={onDismissOverlay} />
|
||||
|
@ -152,8 +146,8 @@ class DashboardsPageContents extends Component<Props, State> {
|
|||
}
|
||||
}
|
||||
|
||||
const mapDispatchToProps = dispatch => ({
|
||||
handleShowOverlay: bindActionCreators(showOverlay, dispatch),
|
||||
})
|
||||
const mapDispatchToProps = {
|
||||
showOverlay: showOverlayAction,
|
||||
}
|
||||
|
||||
export default connect(null, mapDispatchToProps)(DashboardsPageContents)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, {Component} from 'react'
|
||||
import React, {PureComponent} from 'react'
|
||||
import Container from 'src/shared/components/overlay/OverlayContainer'
|
||||
import Heading from 'src/shared/components/overlay/OverlayHeading'
|
||||
import Body from 'src/shared/components/overlay/OverlayBody'
|
||||
|
@ -7,11 +7,7 @@ interface Props {
|
|||
onDismissOverlay: () => void
|
||||
}
|
||||
|
||||
class ImportDashboardOverlay extends Component<Props> {
|
||||
constructor(props: Props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
class ImportDashboardOverlay extends PureComponent<Props> {
|
||||
public render() {
|
||||
const {onDismissOverlay} = this.props
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, {PureComponent, ComponentClass} from 'react'
|
||||
import React, {PureComponent, Component} from 'react'
|
||||
import {connect} from 'react-redux'
|
||||
import {bindActionCreators} from 'redux'
|
||||
import {ErrorHandling} from 'src/shared/decorators/errors'
|
||||
|
@ -6,7 +6,7 @@ import {ErrorHandling} from 'src/shared/decorators/errors'
|
|||
import {dismissOverlay} from 'src/shared/actions/overlayTechnology'
|
||||
|
||||
interface Props {
|
||||
OverlayNode?: ComponentClass<any>
|
||||
OverlayNode?: Component<any>
|
||||
dismissOnClickOutside?: boolean
|
||||
dismissOnEscape?: boolean
|
||||
transitionTime?: number
|
||||
|
|
Loading…
Reference in New Issue