diff options
Diffstat (limited to 'src/components/ui')
-rw-r--r-- | src/components/ui/AppLoader/index.js | 11 | ||||
-rw-r--r-- | src/components/ui/Button.js | 3 | ||||
-rw-r--r-- | src/components/ui/FullscreenLoader/index.js | 7 | ||||
-rw-r--r-- | src/components/ui/ImageUpload.js | 4 | ||||
-rw-r--r-- | src/components/ui/InfoBar.js | 4 | ||||
-rw-r--r-- | src/components/ui/Infobox.js | 2 | ||||
-rw-r--r-- | src/components/ui/Input.js | 6 | ||||
-rw-r--r-- | src/components/ui/Link.js | 1 | ||||
-rw-r--r-- | src/components/ui/PremiumFeatureContainer/index.js | 1 | ||||
-rw-r--r-- | src/components/ui/Radio.js | 4 | ||||
-rw-r--r-- | src/components/ui/SearchInput.js | 27 | ||||
-rw-r--r-- | src/components/ui/Select.js | 1 | ||||
-rw-r--r-- | src/components/ui/StatusBarTargetUrl.js | 3 |
13 files changed, 39 insertions, 35 deletions
diff --git a/src/components/ui/AppLoader/index.js b/src/components/ui/AppLoader/index.js index 31db3d52c..1b9d044f4 100644 --- a/src/components/ui/AppLoader/index.js +++ b/src/components/ui/AppLoader/index.js | |||
@@ -28,11 +28,13 @@ export default @injectSheet(styles) class AppLoader extends Component { | |||
28 | step: 0, | 28 | step: 0, |
29 | } | 29 | } |
30 | 30 | ||
31 | interval = null; | ||
32 | |||
31 | componentDidMount() { | 33 | componentDidMount() { |
32 | this.interval = setInterval(() => { | 34 | this.interval = setInterval(() => { |
33 | this.setState({ | 35 | this.setState(prevState => ({ |
34 | step: this.state.step === textList.length - 1 ? 0 : this.state.step + 1, | 36 | step: prevState.step === textList.length - 1 ? 0 : prevState.step + 1, |
35 | }); | 37 | })); |
36 | }, 2500); | 38 | }, 2500); |
37 | } | 39 | } |
38 | 40 | ||
@@ -40,8 +42,6 @@ export default @injectSheet(styles) class AppLoader extends Component { | |||
40 | clearInterval(this.interval); | 42 | clearInterval(this.interval); |
41 | } | 43 | } |
42 | 44 | ||
43 | interval = null; | ||
44 | |||
45 | render() { | 45 | render() { |
46 | const { classes } = this.props; | 46 | const { classes } = this.props; |
47 | const { step } = this.state; | 47 | const { step } = this.state; |
@@ -66,4 +66,3 @@ export default @injectSheet(styles) class AppLoader extends Component { | |||
66 | ); | 66 | ); |
67 | } | 67 | } |
68 | } | 68 | } |
69 | |||
diff --git a/src/components/ui/Button.js b/src/components/ui/Button.js index 309e05bb4..ffc7f7051 100644 --- a/src/components/ui/Button.js +++ b/src/components/ui/Button.js | |||
@@ -62,6 +62,8 @@ export default @observer class Button extends Component { | |||
62 | } | 62 | } |
63 | 63 | ||
64 | return ( | 64 | return ( |
65 | // disabling rule as button has type defined in `buttonProps` | ||
66 | /* eslint-disable react/button-has-type */ | ||
65 | <button {...buttonProps}> | 67 | <button {...buttonProps}> |
66 | <Loader | 68 | <Loader |
67 | loaded={loaded} | 69 | loaded={loaded} |
@@ -72,6 +74,7 @@ export default @observer class Button extends Component { | |||
72 | /> | 74 | /> |
73 | {label} | 75 | {label} |
74 | </button> | 76 | </button> |
77 | /* eslint-enable react/button-has-type */ | ||
75 | ); | 78 | ); |
76 | } | 79 | } |
77 | } | 80 | } |
diff --git a/src/components/ui/FullscreenLoader/index.js b/src/components/ui/FullscreenLoader/index.js index 36cd32d2a..e0a24a527 100644 --- a/src/components/ui/FullscreenLoader/index.js +++ b/src/components/ui/FullscreenLoader/index.js | |||
@@ -7,7 +7,9 @@ import Loader from '../Loader'; | |||
7 | 7 | ||
8 | import styles from './styles'; | 8 | import styles from './styles'; |
9 | 9 | ||
10 | export default inject('stores')(injectSheet(styles)(({ stores, classes, className, title, children }) => ( | 10 | export default inject('stores')(injectSheet(styles)(({ |
11 | stores, classes, className, title, children, | ||
12 | }) => ( | ||
11 | <div className={classes.wrapper}> | 13 | <div className={classes.wrapper}> |
12 | <div | 14 | <div |
13 | className={classnames({ | 15 | className={classnames({ |
@@ -24,5 +26,4 @@ export default inject('stores')(injectSheet(styles)(({ stores, classes, classNam | |||
24 | )} | 26 | )} |
25 | </div> | 27 | </div> |
26 | </div> | 28 | </div> |
27 | ), | 29 | ))); |
28 | )); | ||
diff --git a/src/components/ui/ImageUpload.js b/src/components/ui/ImageUpload.js index cbe70ac88..83a05554b 100644 --- a/src/components/ui/ImageUpload.js +++ b/src/components/ui/ImageUpload.js | |||
@@ -23,6 +23,8 @@ export default @observer class ImageUpload extends Component { | |||
23 | path: null, | 23 | path: null, |
24 | } | 24 | } |
25 | 25 | ||
26 | dropzoneRef = null; | ||
27 | |||
26 | onDrop(acceptedFiles) { | 28 | onDrop(acceptedFiles) { |
27 | const { field } = this.props; | 29 | const { field } = this.props; |
28 | 30 | ||
@@ -36,8 +38,6 @@ export default @observer class ImageUpload extends Component { | |||
36 | field.set(''); | 38 | field.set(''); |
37 | } | 39 | } |
38 | 40 | ||
39 | dropzoneRef = null; | ||
40 | |||
41 | render() { | 41 | render() { |
42 | const { | 42 | const { |
43 | field, | 43 | field, |
diff --git a/src/components/ui/InfoBar.js b/src/components/ui/InfoBar.js index 94a1ddf76..612399e9f 100644 --- a/src/components/ui/InfoBar.js +++ b/src/components/ui/InfoBar.js | |||
@@ -5,7 +5,7 @@ import classnames from 'classnames'; | |||
5 | import Loader from 'react-loader'; | 5 | import Loader from 'react-loader'; |
6 | 6 | ||
7 | // import { oneOrManyChildElements } from '../../prop-types'; | 7 | // import { oneOrManyChildElements } from '../../prop-types'; |
8 | import Appear from '../ui/effects/Appear'; | 8 | import Appear from './effects/Appear'; |
9 | 9 | ||
10 | export default @observer class InfoBar extends Component { | 10 | export default @observer class InfoBar extends Component { |
11 | static propTypes = { | 11 | static propTypes = { |
@@ -64,6 +64,7 @@ export default @observer class InfoBar extends Component { | |||
64 | {children} | 64 | {children} |
65 | {ctaLabel && ( | 65 | {ctaLabel && ( |
66 | <button | 66 | <button |
67 | type="button" | ||
67 | className="info-bar__cta" | 68 | className="info-bar__cta" |
68 | onClick={onClick} | 69 | onClick={onClick} |
69 | > | 70 | > |
@@ -80,6 +81,7 @@ export default @observer class InfoBar extends Component { | |||
80 | </div> | 81 | </div> |
81 | {!sticky && ( | 82 | {!sticky && ( |
82 | <button | 83 | <button |
84 | type="button" | ||
83 | className="info-bar__close mdi mdi-close" | 85 | className="info-bar__close mdi mdi-close" |
84 | onClick={onHide} | 86 | onClick={onHide} |
85 | /> | 87 | /> |
diff --git a/src/components/ui/Infobox.js b/src/components/ui/Infobox.js index 77051f567..a33c6474a 100644 --- a/src/components/ui/Infobox.js +++ b/src/components/ui/Infobox.js | |||
@@ -61,6 +61,7 @@ export default @observer class Infobox extends Component { | |||
61 | <button | 61 | <button |
62 | className="infobox__cta" | 62 | className="infobox__cta" |
63 | onClick={ctaOnClick} | 63 | onClick={ctaOnClick} |
64 | type="button" | ||
64 | > | 65 | > |
65 | <Loader | 66 | <Loader |
66 | loaded={!ctaLoading} | 67 | loaded={!ctaLoading} |
@@ -74,6 +75,7 @@ export default @observer class Infobox extends Component { | |||
74 | )} | 75 | )} |
75 | {dismissable && ( | 76 | {dismissable && ( |
76 | <button | 77 | <button |
78 | type="button" | ||
77 | onClick={() => this.setState({ | 79 | onClick={() => this.setState({ |
78 | dismissed: true, | 80 | dismissed: true, |
79 | })} | 81 | })} |
diff --git a/src/components/ui/Input.js b/src/components/ui/Input.js index 7bf6e1b00..9b070c4df 100644 --- a/src/components/ui/Input.js +++ b/src/components/ui/Input.js | |||
@@ -33,6 +33,8 @@ export default @observer class Input extends Component { | |||
33 | passwordScore: 0, | 33 | passwordScore: 0, |
34 | } | 34 | } |
35 | 35 | ||
36 | inputElement = null; | ||
37 | |||
36 | componentDidMount() { | 38 | componentDidMount() { |
37 | if (this.props.focus) { | 39 | if (this.props.focus) { |
38 | this.focus(); | 40 | this.focus(); |
@@ -53,8 +55,6 @@ export default @observer class Input extends Component { | |||
53 | this.inputElement.focus(); | 55 | this.inputElement.focus(); |
54 | } | 56 | } |
55 | 57 | ||
56 | inputElement = null; | ||
57 | |||
58 | render() { | 58 | render() { |
59 | const { | 59 | const { |
60 | field, | 60 | field, |
@@ -110,7 +110,7 @@ export default @observer class Input extends Component { | |||
110 | 'mdi-eye': !this.state.showPassword, | 110 | 'mdi-eye': !this.state.showPassword, |
111 | 'mdi-eye-off': this.state.showPassword, | 111 | 'mdi-eye-off': this.state.showPassword, |
112 | })} | 112 | })} |
113 | onClick={() => this.setState({ showPassword: !this.state.showPassword })} | 113 | onClick={() => this.setState(prevState => ({ showPassword: !prevState.showPassword }))} |
114 | tabIndex="-1" | 114 | tabIndex="-1" |
115 | /> | 115 | /> |
116 | )} | 116 | )} |
diff --git a/src/components/ui/Link.js b/src/components/ui/Link.js index 0602290f1..b88686d5e 100644 --- a/src/components/ui/Link.js +++ b/src/components/ui/Link.js | |||
@@ -72,5 +72,4 @@ Link.wrappedComponent.defaultProps = { | |||
72 | activeClassName: '', | 72 | activeClassName: '', |
73 | strictFilter: false, | 73 | strictFilter: false, |
74 | target: '', | 74 | target: '', |
75 | openInBrowser: false, | ||
76 | }; | 75 | }; |
diff --git a/src/components/ui/PremiumFeatureContainer/index.js b/src/components/ui/PremiumFeatureContainer/index.js index 73984be94..67cd6af0b 100644 --- a/src/components/ui/PremiumFeatureContainer/index.js +++ b/src/components/ui/PremiumFeatureContainer/index.js | |||
@@ -73,4 +73,3 @@ PremiumFeatureContainer.wrappedComponent.propTypes = { | |||
73 | }).isRequired, | 73 | }).isRequired, |
74 | }).isRequired, | 74 | }).isRequired, |
75 | }; | 75 | }; |
76 | |||
diff --git a/src/components/ui/Radio.js b/src/components/ui/Radio.js index 63ca6f9b8..ba13aca63 100644 --- a/src/components/ui/Radio.js +++ b/src/components/ui/Radio.js | |||
@@ -18,6 +18,8 @@ export default @observer class Radio extends Component { | |||
18 | showLabel: true, | 18 | showLabel: true, |
19 | }; | 19 | }; |
20 | 20 | ||
21 | inputElement = null; | ||
22 | |||
21 | componentDidMount() { | 23 | componentDidMount() { |
22 | if (this.props.focus) { | 24 | if (this.props.focus) { |
23 | this.focus(); | 25 | this.focus(); |
@@ -28,8 +30,6 @@ export default @observer class Radio extends Component { | |||
28 | this.inputElement.focus(); | 30 | this.inputElement.focus(); |
29 | } | 31 | } |
30 | 32 | ||
31 | inputElement = null; | ||
32 | |||
33 | render() { | 33 | render() { |
34 | const { | 34 | const { |
35 | field, | 35 | field, |
diff --git a/src/components/ui/SearchInput.js b/src/components/ui/SearchInput.js index 5a9571d27..78d6aae8b 100644 --- a/src/components/ui/SearchInput.js +++ b/src/components/ui/SearchInput.js | |||
@@ -2,7 +2,6 @@ import React, { Component } from 'react'; | |||
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import classnames from 'classnames'; | 4 | import classnames from 'classnames'; |
5 | import uuidv1 from 'uuid/v1'; | ||
6 | import { debounce } from 'lodash'; | 5 | import { debounce } from 'lodash'; |
7 | 6 | ||
8 | export default @observer class SearchInput extends Component { | 7 | export default @observer class SearchInput extends Component { |
@@ -22,7 +21,7 @@ export default @observer class SearchInput extends Component { | |||
22 | value: '', | 21 | value: '', |
23 | placeholder: '', | 22 | placeholder: '', |
24 | className: '', | 23 | className: '', |
25 | name: uuidv1(), | 24 | name: 'searchInput', |
26 | throttle: false, | 25 | throttle: false, |
27 | throttleDelay: 250, | 26 | throttleDelay: 250, |
28 | onChange: () => null, | 27 | onChange: () => null, |
@@ -30,6 +29,8 @@ export default @observer class SearchInput extends Component { | |||
30 | autoFocus: false, | 29 | autoFocus: false, |
31 | } | 30 | } |
32 | 31 | ||
32 | input = null; | ||
33 | |||
33 | constructor(props) { | 34 | constructor(props) { |
34 | super(props); | 35 | super(props); |
35 | 36 | ||
@@ -74,8 +75,6 @@ export default @observer class SearchInput extends Component { | |||
74 | onReset(); | 75 | onReset(); |
75 | } | 76 | } |
76 | 77 | ||
77 | input = null; | ||
78 | |||
79 | render() { | 78 | render() { |
80 | const { className, name, placeholder } = this.props; | 79 | const { className, name, placeholder } = this.props; |
81 | const { value } = this.state; | 80 | const { value } = this.state; |
@@ -90,15 +89,17 @@ export default @observer class SearchInput extends Component { | |||
90 | <label | 89 | <label |
91 | htmlFor={name} | 90 | htmlFor={name} |
92 | className="mdi mdi-magnify" | 91 | className="mdi mdi-magnify" |
93 | /> | 92 | > |
94 | <input | 93 | <input |
95 | name={name} | 94 | name={name} |
96 | type="text" | 95 | id={name} |
97 | placeholder={placeholder} | 96 | type="text" |
98 | value={value} | 97 | placeholder={placeholder} |
99 | onChange={e => this.onChange(e)} | 98 | value={value} |
100 | ref={(ref) => { this.input = ref; }} | 99 | onChange={e => this.onChange(e)} |
101 | /> | 100 | ref={(ref) => { this.input = ref; }} |
101 | /> | ||
102 | </label> | ||
102 | {value.length > 0 && ( | 103 | {value.length > 0 && ( |
103 | <span | 104 | <span |
104 | className="mdi mdi-close-circle-outline" | 105 | className="mdi mdi-close-circle-outline" |
diff --git a/src/components/ui/Select.js b/src/components/ui/Select.js index 102737bec..6e91300e3 100644 --- a/src/components/ui/Select.js +++ b/src/components/ui/Select.js | |||
@@ -14,7 +14,6 @@ export default @observer class Select extends Component { | |||
14 | 14 | ||
15 | static defaultProps = { | 15 | static defaultProps = { |
16 | className: null, | 16 | className: null, |
17 | focus: false, | ||
18 | showLabel: true, | 17 | showLabel: true, |
19 | disabled: false, | 18 | disabled: false, |
20 | }; | 19 | }; |
diff --git a/src/components/ui/StatusBarTargetUrl.js b/src/components/ui/StatusBarTargetUrl.js index 4285a343c..6fc50fe5c 100644 --- a/src/components/ui/StatusBarTargetUrl.js +++ b/src/components/ui/StatusBarTargetUrl.js | |||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; | |||
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import classnames from 'classnames'; | 4 | import classnames from 'classnames'; |
5 | 5 | ||
6 | import Appear from '../ui/effects/Appear'; | 6 | import Appear from './effects/Appear'; |
7 | 7 | ||
8 | export default @observer class StatusBarTargetUrl extends Component { | 8 | export default @observer class StatusBarTargetUrl extends Component { |
9 | static propTypes = { | 9 | static propTypes = { |
@@ -13,7 +13,6 @@ export default @observer class StatusBarTargetUrl extends Component { | |||
13 | 13 | ||
14 | static defaultProps = { | 14 | static defaultProps = { |
15 | className: '', | 15 | className: '', |
16 | position: 'bottom', | ||
17 | text: '', | 16 | text: '', |
18 | }; | 17 | }; |
19 | 18 | ||