@@ -13,6 +13,7 @@ import PT from 'prop-types';
13
13
import Tooltip from 'components/Tooltip' ;
14
14
import Avatar from 'components/Avatar' ;
15
15
import styles from './style.scss' ;
16
+ import config from 'utils/config' ;
16
17
17
18
/**
18
19
* Renders the tooltip's content.
@@ -31,10 +32,7 @@ function Tip(props) {
31
32
</span>
32
33
)); */
33
34
const { photoLink } = props . user ;
34
- let src = null ;
35
- if ( photoLink ) {
36
- src = photoLink . startsWith ( 'https' ) ? photoLink : `${ props . MAIN_URL } /${ photoLink } ` ;
37
- }
35
+ const src = photoLink . startsWith ( 'https' ) ? photoLink : `${ config . URL . BASE } /${ photoLink } ` ;
38
36
39
37
return (
40
38
< div styleName = "user-avatar-tooltip" >
@@ -43,7 +41,6 @@ function Tip(props) {
43
41
avatar : styles . avatar ,
44
42
} }
45
43
url = { src }
46
- handleError = { props . handleError }
47
44
/>
48
45
< div styleName = "handle" > { props . user . handle } </ div >
49
46
{ /* Below block is commented out as it's not possible to get this information
@@ -62,8 +59,6 @@ function Tip(props) {
62
59
}
63
60
64
61
Tip . propTypes = {
65
- handleError : PT . func . isRequired ,
66
- MAIN_URL : PT . string ,
67
62
user : PT . shape ( {
68
63
country : PT . string ,
69
64
handle : PT . string ,
@@ -73,10 +68,6 @@ Tip.propTypes = {
73
68
} ) . isRequired ,
74
69
} ;
75
70
76
- Tip . defaultProps = {
77
- MAIN_URL : process . env . MAIN_URL ,
78
- } ;
79
-
80
71
/**
81
72
* Renders the tooltip.
82
73
*/
@@ -86,16 +77,10 @@ class UserAvatarTooltip extends Component {
86
77
this . state = {
87
78
user : props . user ,
88
79
} ;
89
- this . handleError = this . handleError . bind ( this ) ;
90
- }
91
- handleError ( ) {
92
- const user = this . state . user ;
93
- user . photoLink = null ;
94
- this . setState ( { user } ) ;
95
80
}
96
81
97
82
render ( ) {
98
- const tip = < Tip user = { this . state . user } handleError = { this . handleError } /> ;
83
+ const tip = < Tip user = { this . state . user } /> ;
99
84
return (
100
85
< Tooltip content = { tip } >
101
86
< div > { this . props . children } </ div >
0 commit comments