@@ -32,15 +32,6 @@ const InstallDescription = styled(Text)`
3232 color: rgb(${ GetGlobalColor ( 'white' ) } );
3333`
3434
35- const InstallAnchor = styled . a `
36- &,
37- &:visited,
38- &:hover,
39- &:active {
40- color: inherit;
41- }
42- `
43-
4435const Description = styled ( Text ) `
4536 width: 200px;
4637 height: 15px;
@@ -61,7 +52,7 @@ const CloseButton = styled.img`
6152 margin: 27px 16px 27px 0;
6253`
6354
64- export const FloatingInstallButton = ( {
55+ export default function FloatingInstallButton ( {
6556 appInstallLink,
6657 isPublic,
6758 trackEvent,
@@ -75,35 +66,39 @@ export const FloatingInstallButton = ({
7566 onSelect ?: any
7667 onClose ?: any
7768 }
78- } ) => {
69+ } ) {
7970 const [ buttonVisibility , setButtonVisibility ] = useState ( false )
8071
72+ const sendTrackEventRequest = ( param ) => {
73+ trackEvent && param && trackEvent ( param )
74+ }
75+
8176 useEffect ( ( ) => {
8277 const visitedPages = window . sessionStorage . getItem ( CLOSE_INSTALL_BUTTON_KEY )
8378 if ( ! visitedPages ) {
8479 setButtonVisibility ( true )
85- trackEvent && trackEvent ( trackEventParams . onShow )
80+ sendTrackEventRequest ( trackEventParams && trackEventParams . onShow )
8681 }
8782 } )
8883
8984 const onClose = ( ) => {
9085 setButtonVisibility ( false )
9186 window . sessionStorage . setItem ( CLOSE_INSTALL_BUTTON_KEY , 'true' )
92- trackEvent && trackEvent ( trackEventParams . onClose )
87+ sendTrackEventRequest ( trackEventParams && trackEventParams . onClose )
9388 }
9489
9590 const onSelect = ( ) => {
96- trackEvent && trackEvent ( trackEventParams . onSelect )
91+ sendTrackEventRequest ( trackEventParams && trackEventParams . onSelect )
9792 }
9893
9994 return buttonVisibility && isPublic ? (
10095 < FloatingButton >
10196 < Container floated = "left" >
10297 < InstallDescription >
103- < InstallAnchor href = { appInstallLink } onClick = { onSelect } >
98+ < a href = { appInstallLink } onClick = { onSelect } >
10499 < Container floated = "left" > 트리플 앱 설치하기</ Container >
105100 < GoAppButton src = "https://assets.triple.guide/images/[email protected] " /> 106- </ InstallAnchor >
101+ </ a >
107102 </ InstallDescription >
108103 < Description > 가이드북, 일정짜기, 길찾기, 맛집</ Description >
109104 </ Container >
0 commit comments