Skip to content

Commit

Permalink
navigate distructuring 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
dongoc committed Nov 29, 2023
1 parent 7b4e64e commit df7a4ff
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/standard-action-handler/src/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useNavigate, useExternalRouter } from '@titicaca/router'
import { initialize } from './index'

export function useStandardActionHandler() {
const navigate = useNavigate()
const { navigate } = useNavigate()
const routeExternally = useExternalRouter()

return initialize({ navigate, routeExternally })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function isPropsForInventoryApi(
function useAdBannerProps(props: AdBannersProps) {
const { latitude, longitude } = useDeviceContext()
const trackEvent = useTrackEvent()
const navigate = useNavigate()
const { navigate } = useNavigate()

if (isPropsForInventoryApi(props)) {
const { onBannersFetch, onBannerIntersect, onBannerClick } = props
Expand Down
2 changes: 1 addition & 1 deletion packages/tds-widget/src/ad-banner/list-top-banners.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function isPropsForInventoryApi(
function useAdBannerProps(props: AdBannersProps) {
const { latitude, longitude } = useDeviceContext()
const trackEvent = useTrackEvent()
const navigate = useNavigate()
const { navigate } = useNavigate()

if (isPropsForInventoryApi(props)) {
const { onBannersFetch, onBannerIntersect, onBannerClick } = props
Expand Down
2 changes: 1 addition & 1 deletion packages/tds-widget/src/booking-completion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function BookingCompletion({
const { t } = useTranslation('triple-frontend')

const regionName = region?.names.ko || region?.names.en
const navigate = useNavigate()
const { navigate } = useNavigate()

const handleMoveToRegion = useAppCallback(
TransitionType.General,
Expand Down
2 changes: 1 addition & 1 deletion packages/tds-widget/src/nearby-pois/poi-entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function PoiEntry({
optimized?: boolean
}) {
const trackEvent = useTrackEvent()
const navigate = useNavigate()
const { navigate } = useNavigate()

const handleIntersectionChange = useCallback(
({ isIntersecting }: { isIntersecting: boolean }) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/tds-widget/src/replies/list/reply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function Reply({
const { setEditingMessage } = useRepliesContext()
const { addUriHash, removeUriHash } = useHashRouter()
const { asyncBack } = useIsomorphicNavigation()
const navigate = useNavigate()
const { navigate } = useNavigate()
const likeReactionCount = likeReaction?.count

const handleMoreClick = useCallback(
Expand Down Expand Up @@ -432,7 +432,7 @@ function Content({

const [unfolded, setUnfolded] = useState(false)
const foldedPosition = findFoldedPosition(5, text)
const navigate = useNavigate()
const { navigate } = useNavigate()

const handleMentiondUserNameClick = useAppCallback(
TransitionType.General,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { SortingType, SortingOption } from '../components/sorting-context'

export function useClientActions() {
const { appUrlScheme } = useEnv()
const navigate = useNavigate()
const { navigate } = useNavigate()
const { getWindowId } = useTripleClientActions()

return useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/tds-widget/src/social-reviews/social-review.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function SocialReviews({
const { t } = useTranslation('triple-frontend')

const trackEvent = useTrackEvent()
const navigate = useNavigate()
const { navigate } = useNavigate()

if (!socialReviews || socialReviews.length === 0) {
return null
Expand Down
2 changes: 1 addition & 1 deletion packages/triple-document/src/elements/coupon/modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const CouponIcon = styled.img`
export function CouponModal({ identifier }: { identifier: string }) {
const { t } = useTranslation('triple-frontend')
const { uriHash, removeUriHash } = useHashRouter()
const navigate = useNavigate()
const { navigate } = useNavigate()

const modalHash = uriHash.replace(`${identifier}.`, '')

Expand Down
2 changes: 1 addition & 1 deletion packages/triple-document/src/elements/itinerary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export default function ItineraryElement({ value }: Props) {
const { courses, regionId, poiIds, hasItineraries, hideAddButton } =
useItinerary(value)
const addPoisToTrip = useHandleAddPoisToTrip(regionId || '')
const navigate = useNavigate()
const { navigate } = useNavigate()

const generatePoiClickHandler = useCallback(
({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useNavigate } from '@titicaca/router'
*/
export default function useHandleAddPoiToTrip(regionId?: string) {
const { appUrlScheme } = useEnv()
const navigate = useNavigate()
const { navigate } = useNavigate()

const handleFn = useCallback(
(poiId: string | string[]) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/triple-document/src/elements/tna/slot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function Slot({
const { t } = useTranslation('triple-frontend')
const { colors } = useTheme()
const trackEvent = useTrackEvent()
const navigate = useNavigate()
const { navigate } = useNavigate()

const [showMore, setShowMore] = useState(false)

Expand Down
2 changes: 1 addition & 1 deletion packages/triple-document/src/triple-document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function TripleDocument({
} & TripleDocumentContext) {
const trackEventWithMetadata = useTrackEventWithMetadata()
const trackResourceEvent = useEventResourceTracker()
const navigate = useNavigate()
const { navigate } = useNavigate()
const routeExternally = useExternalRouter()

const handleAction = useMemo(
Expand Down
2 changes: 1 addition & 1 deletion packages/triple-header/src/frame/frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function Frame({
const heightRatio = calculateFrameRatio(height)

const trackEventWithMetadata = useTrackEventWithMetadata()
const navigate = useNavigate()
const { navigate } = useNavigate()
const routeExternally = useExternalRouter()

const handleAction = useMemo(
Expand Down

0 comments on commit df7a4ff

Please sign in to comment.