11// @flow
2- import React from 'react' ;
2+ import * as React from 'react' ;
33import { bindActionCreators } from 'redux' ;
44import { spring , Motion } from 'react-motion' ;
55import styled from 'styled-components' ;
@@ -45,7 +45,8 @@ const Item = styled.div`
4545 &:hover {
4646 color: ${ props => ( props . color ? props . color : theme . secondary ( ) ) } ;
4747 background-color: ${ ( ) => theme . background2 . lighten ( 0.3 ) ( ) } ;
48- border-left-color: ${ props => ( props . color ? props . color : theme . secondary ( ) ) } ;
48+ border-left-color: ${ props =>
49+ props . color ? props . color : theme . secondary ( ) } ;
4950 }
5051` ;
5152
@@ -60,9 +61,8 @@ const mapStateToProps = state => ({
6061const mapDispatchToProps = dispatch => ( {
6162 contextMenuActions : bindActionCreators ( contextMenuActionCreators , dispatch ) ,
6263} ) ;
63- class ContextMenu extends React . PureComponent {
64+ class ContextMenu extends React . PureComponent < Props > {
6465 interval : number ;
65- props : Props ;
6666
6767 setup = el => {
6868 this . mousedown = window . addEventListener ( 'mousedown' , event => {
@@ -111,7 +111,7 @@ class ContextMenu extends React.PureComponent {
111111 opacity : spring ( 1 ) ,
112112 } }
113113 >
114- { ( { size, opacity } ) => (
114+ { ( { size, opacity } ) =>
115115 < Container
116116 style = { {
117117 left : contextMenu . x + 10 ,
@@ -121,19 +121,18 @@ class ContextMenu extends React.PureComponent {
121121 } }
122122 >
123123 < div >
124- { contextMenu . items . map ( item => (
124+ { contextMenu . items . map ( item =>
125125 < Item
126126 key = { item . title }
127127 color = { item . color }
128128 onClick = { ( ) => item . action ( ) && this . close ( ) }
129129 >
130130 { item . icon && < item . icon /> }
131131 { item . title }
132- </ Item >
133- ) ) }
132+ </ Item > ,
133+ ) }
134134 </ div >
135- </ Container >
136- ) }
135+ </ Container > }
137136 </ Motion > }
138137 </ div >
139138 </ Portal >
0 commit comments