@@ -5,7 +5,8 @@ import classnames from 'classnames';
5
5
6
6
import { rootStore } from '../../stores' ;
7
7
import { popupActions } from '../../actions/popupActions' ;
8
- import { reactTranslator } from '../../../common/reactTranslator' ;
8
+ import { translator } from '../../../common/translator' ;
9
+ import { Icon } from '../ui/Icon' ;
9
10
10
11
import './header.pcss' ;
11
12
@@ -18,8 +19,7 @@ export const Header = observer(({ showMenuButton }: { showMenuButton: boolean })
18
19
uiStore . openOptionsModal ( ) ;
19
20
} ;
20
21
21
- const handleOpenReferral = async ( e : React . MouseEvent < HTMLButtonElement > | React . MouseEvent < HTMLAnchorElement > ) => {
22
- e . preventDefault ( ) ;
22
+ const handleOpenReferral = async ( ) => {
23
23
await popupActions . openFreeGbsPage ( ) ;
24
24
} ;
25
25
@@ -45,38 +45,28 @@ export const Header = observer(({ showMenuButton }: { showMenuButton: boolean })
45
45
< div className = "header__logo" >
46
46
< div className = "logo" />
47
47
</ div >
48
- { shouldShowGiftBtn && (
49
- < div className = "header__referral" >
48
+ < div className = "header__actions" >
49
+ { shouldShowGiftBtn && (
50
+ < button className = "header__referral" type = "button" onClick = { handleOpenReferral } >
51
+ < span className = "button header__referral__button" >
52
+ < Icon icon = "gift" className = "icon--button" />
53
+ </ span >
54
+ < span className = "header__referral__hint" >
55
+ { translator . getMessage ( 'referral_get_free_traffic' ) }
56
+ </ span >
57
+ </ button >
58
+ ) }
59
+ { showMenuButton && (
50
60
< button
51
- className = "button header__referral__button "
61
+ className = "button header__setting "
52
62
type = "button"
53
- onClick = { handleOpenReferral }
63
+ tabIndex = { tabIndex }
64
+ onClick = { handleOpenModal }
54
65
>
55
- < svg className = "icon icon--button" >
56
- < use xlinkHref = "#gift" />
57
- </ svg >
66
+ < Icon icon = "bar" className = "icon--button icon--popup-menu" />
58
67
</ button >
59
- < a
60
- className = "header__referral__hint"
61
- href = "#"
62
- onClick = { handleOpenReferral }
63
- >
64
- { reactTranslator . getMessage ( 'referral_get_free_traffic' ) }
65
- </ a >
66
- </ div >
67
- ) }
68
- { showMenuButton && (
69
- < button
70
- className = "button header__setting"
71
- type = "button"
72
- tabIndex = { tabIndex }
73
- onClick = { handleOpenModal }
74
- >
75
- < svg className = "icon icon--button icon--popup-menu" >
76
- < use xlinkHref = "#bar" />
77
- </ svg >
78
- </ button >
79
- ) }
68
+ ) }
69
+ </ div >
80
70
</ div >
81
71
) ;
82
72
} ) ;
0 commit comments