Skip to content

Commit

Permalink
onCallGrabButtonClick 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
dongoc committed Nov 29, 2023
1 parent c4f582d commit a9c1b81
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions packages/directions-finder/src/direction-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {
useHistoryFunctions,
useUriHash,
} from '@titicaca/react-contexts'
import { useTripleClientMetadata } from '@titicaca/react-triple-client-interfaces'
import {
useTripleClientMetadata,
useTripleClientNavigate,
} from '@titicaca/react-triple-client-interfaces'
import { Button, ButtonGroup, Container } from '@titicaca/core-elements'

import AskToTheLocal from './ask-to-the-local'
Expand All @@ -17,6 +20,9 @@ const LinkBreak = styled(Container)`
height: 0;
`

// TODO 그랩 아웃링크 추가하기
const GRAB_OUTLINK = 'grab'

function DirectionButtons({
onDirectionsClick,
primaryName,
Expand All @@ -39,17 +45,18 @@ function DirectionButtons({
const app = useTripleClientMetadata()
const uriHash = useUriHash()
const { push, back, showTransitionModal } = useHistoryFunctions()
const { trackSimpleEvent } = useEventTrackingContext()

// const onCallGrabButtonClick = useCallback(() => {
// // TODO
// }, [])
const { trackEvent } = useEventTrackingContext()
const { openOutlink } = useTripleClientNavigate()

const handleAskToLocalsClick = useCallback(() => {
trackSimpleEvent({ action: '기본정보_현지에서길묻기' })

trackEvent({ fa: { action: '기본정보_현지에서길묻기' } })
app ? push(HASH_ASK_TO_LOCALS_POPUP) : showTransitionModal()
}, [trackSimpleEvent, push, showTransitionModal, app])
}, [trackEvent, push, showTransitionModal, app])

const onCallGrabButtonClick = useCallback(() => {
trackEvent({ fa: { action: '기본정보_그랩호출하기' } })
app ? openOutlink(GRAB_OUTLINK) : showTransitionModal()
}, [trackEvent, showTransitionModal, app])

const hasAskToLocalsButton = !!(localName && localAddress)
const hasLineBreak = hasAskToLocalsButton && isGrabSupported
Expand All @@ -76,7 +83,7 @@ function DirectionButtons({
inverted
color="blue"
size="small"
// onClick={onCallGrabButtonClick}
onClick={onCallGrabButtonClick}
>
{t(['grab-hocul', 'Grab 호출'])}
</Button>
Expand Down

0 comments on commit a9c1b81

Please sign in to comment.