Merged in feat/sw-3125-move-client-trpc-setup (pull request #2493)
feat(SW-3125): Move client trpc setup * Move client trpc to package * Client setup in partner-sas * Add todo Approved-by: Linus Flood
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { keepPreviousData } from "@tanstack/react-query"
|
||||
import { useState } from "react"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import LoadingSpinner from "@/components/LoadingSpinner"
|
||||
import Pagination from "@/components/MyPages/Pagination"
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import { useRef, useState } from "react"
|
||||
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { type Reward } from "@scandic-hotels/trpc/types/rewards"
|
||||
|
||||
import { REWARDS_PER_PAGE } from "@/constants/rewards"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import { RewardIcon } from "@/components/Blocks/DynamicContent/Rewards/RewardIcon"
|
||||
import ScriptedRewardText from "@/components/Blocks/DynamicContent/Rewards/ScriptedRewardText"
|
||||
|
||||
@@ -11,8 +11,7 @@ import {
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { createContext, useCallback, useContext, useEffect } from "react"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { getFirstRedeemableCoupon } from "@/utils/rewards"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import LoadingSpinner from "@/components/LoadingSpinner"
|
||||
import Grids from "@/components/TempDesignSystem/Grids"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import LoadingSpinner from "@/components/LoadingSpinner"
|
||||
import Grids from "@/components/TempDesignSystem/Grids"
|
||||
|
||||
@@ -7,9 +7,9 @@ import { FormProvider, useForm } from "react-hook-form"
|
||||
|
||||
import { dt } from "@scandic-hotels/common/dt"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { StickyElementNameEnum } from "@/stores/sticky-position"
|
||||
|
||||
import Form, {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { usePathname } from "next/navigation"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import SkeletonShimmer from "@/components/SkeletonShimmer"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
@@ -6,8 +6,7 @@ import { useDebounceValue } from "usehooks-ts"
|
||||
|
||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
|
||||
@@ -6,11 +6,11 @@ import { FormProvider, useForm } from "react-hook-form"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { profile } from "@scandic-hotels/common/constants/routes/myPages"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { langToApiLang } from "@scandic-hotels/trpc/constants/apiLang"
|
||||
|
||||
import { getDefaultCountryFromLang } from "@/constants/languages"
|
||||
import { logout } from "@/constants/routes/handleAuth"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import { editProfile } from "@/actions/editProfile"
|
||||
import Dialog from "@/components/Dialog"
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { Button } from "@scandic-hotels/design-system/Button"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import {
|
||||
type SignUpSchema,
|
||||
signUpSchema,
|
||||
@@ -18,7 +19,6 @@ import {
|
||||
membershipTermsAndConditions,
|
||||
privacyPolicy,
|
||||
} from "@/constants/webHrefs"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import Checkbox from "@/components/TempDesignSystem/Form/Checkbox"
|
||||
import CountrySelect from "@/components/TempDesignSystem/Form/Country"
|
||||
|
||||
@@ -5,9 +5,9 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { logout } from "@/constants/routes/handleAuth"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
|
||||
@@ -4,8 +4,7 @@ import { useSession } from "next-auth/react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MembershipLevelEnum } from "@scandic-hotels/common/constants/membershipLevels"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import LoginButton from "@/components/LoginButton"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useEffect } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { useBookingConfirmationStore } from "@/stores/booking-confirmation"
|
||||
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
@@ -12,6 +12,7 @@ import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMetho
|
||||
import { selectRate } from "@scandic-hotels/common/constants/routes/hotelReservation"
|
||||
import { Button } from "@scandic-hotels/design-system/Button"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { bedTypeMap } from "@scandic-hotels/trpc/constants/bedTypeMap"
|
||||
import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking"
|
||||
import { BookingStatusEnum } from "@scandic-hotels/trpc/enums/bookingStatus"
|
||||
@@ -20,7 +21,6 @@ import { RoomPackageCodeEnum } from "@scandic-hotels/trpc/enums/roomFilter"
|
||||
import { PAYMENT_METHOD_TITLES } from "@/constants/booking"
|
||||
import { bookingConfirmation } from "@/constants/routes/hotelReservation"
|
||||
import { env } from "@/env/client"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { useEnterDetailsStore } from "@/stores/enter-details"
|
||||
|
||||
import PaymentOption from "@/components/HotelReservation/PaymentOption"
|
||||
|
||||
@@ -6,9 +6,9 @@ import { FormProvider, useForm } from "react-hook-form"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { customerService } from "@/constants/webHrefs"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import Input from "@/components/TempDesignSystem/Form/Input"
|
||||
|
||||
@@ -10,11 +10,11 @@ import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMetho
|
||||
import { dt } from "@scandic-hotels/common/dt"
|
||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast"
|
||||
|
||||
import { guaranteeCallback } from "@/constants/routes/hotelReservation"
|
||||
import { env } from "@/env/client"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import {
|
||||
AncillaryStepEnum,
|
||||
type BreakfastData,
|
||||
|
||||
@@ -2,8 +2,7 @@ import { useRouter } from "next/navigation"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import Dialog from "@/components/Dialog"
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useRouter } from "next/navigation"
|
||||
import { useEffect } from "react"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import {
|
||||
clearAncillarySessionData,
|
||||
|
||||
@@ -9,9 +9,9 @@ import { useIntl } from "react-intl"
|
||||
import { profileEdit } from "@scandic-hotels/common/constants/routes/myPages"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { isWebview } from "@/constants/routes/webviews"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import MembershipLevelIcon from "@/components/Levels/Icon"
|
||||
import Modal from "@/components/Modal"
|
||||
|
||||
@@ -3,8 +3,8 @@ import { useWatch } from "react-hook-form"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { useMyStayStore } from "@/stores/my-stay"
|
||||
|
||||
import Modal from "@/components/HotelReservation/MyStay/Modal"
|
||||
|
||||
@@ -3,9 +3,9 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { dt } from "@scandic-hotels/common/dt"
|
||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { longDateWithYearFormat } from "@/constants/dateFormats"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { useMyStayStore } from "@/stores/my-stay"
|
||||
|
||||
import Modal from "@/components/HotelReservation/MyStay/Modal"
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useState } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { useMyStayStore } from "@/stores/my-stay"
|
||||
|
||||
import { sumPackages } from "@/components/HotelReservation/utils"
|
||||
|
||||
@@ -17,9 +17,9 @@ import { ChipButton } from "@scandic-hotels/design-system/ChipButton"
|
||||
import { IconButton } from "@scandic-hotels/design-system/IconButton"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { RateTypeEnum } from "@scandic-hotels/trpc/enums/rateType"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { useRatesStore } from "@/stores/select-rate"
|
||||
|
||||
import { useRoomContext } from "@/contexts/SelectRate/Room"
|
||||
|
||||
@@ -5,8 +5,8 @@ import { useIntl } from "react-intl"
|
||||
import { Button } from "@scandic-hotels/design-system/Button"
|
||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { useRatesStore } from "@/stores/select-rate"
|
||||
|
||||
import { useRoomContext } from "@/contexts/SelectRate/Room"
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useMediaQuery } from "usehooks-ts"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { useRatesStore } from "@/stores/select-rate"
|
||||
|
||||
import { useRoomContext } from "@/contexts/SelectRate/Room"
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
import { notFound, useSearchParams } from "next/navigation"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { selectRateRoomsAvailabilityInputSchema } from "@scandic-hotels/trpc/routers/hotels/input"
|
||||
import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import Alert from "@/components/TempDesignSystem/Alert"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import RatesProvider from "@/providers/RatesProvider"
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
import { useEffect } from "react"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import useSidePeekStore from "@/stores/sidepeek"
|
||||
|
||||
import HotelSidePeek from "@/components/SidePeeks/HotelSidePeek"
|
||||
|
||||
@@ -7,9 +7,9 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { languages } from "@/constants/languages"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import useDropdownStore from "@/stores/main-menu"
|
||||
|
||||
import useClickOutside from "@/hooks/useClickOutside"
|
||||
|
||||
@@ -5,9 +5,9 @@ import { useEffect, useRef } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { partnerSas } from "@scandic-hotels/common/constants/routes/myPages"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import { TIER_TO_FRIEND_MAP } from "@/constants/membershipLevels"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import { toast } from "@/components/TempDesignSystem/Toasts"
|
||||
import useLang from "@/hooks/useLang"
|
||||
|
||||
@@ -8,13 +8,13 @@ import { useIntl } from "react-intl"
|
||||
|
||||
import { benefits } from "@scandic-hotels/common/constants/routes/myPages"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import {
|
||||
benefits as webviewBenefits,
|
||||
myPagesWebviews,
|
||||
} from "@/constants/routes/webviews"
|
||||
import { customerService } from "@/constants/webHrefs"
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import { toast } from "@/components/TempDesignSystem/Toasts"
|
||||
|
||||
@@ -5,8 +5,7 @@ import { useEffect, useRef } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import { toast } from "@/components/TempDesignSystem/Toasts"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import React from "react"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import CreditCardRow from "../CreditCardRow"
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import Dialog from "@/components/Dialog"
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import { toast } from "@/components/TempDesignSystem/Toasts"
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
import { useCallback, useRef } from "react"
|
||||
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { StickyElementNameEnum } from "@/stores/sticky-position"
|
||||
|
||||
import Alert from "@/components/TempDesignSystem/Alert"
|
||||
|
||||
@@ -15,7 +15,8 @@ import {
|
||||
type UseFromSubscribe,
|
||||
} from "react-hook-form"
|
||||
|
||||
import { trpc } from "@/lib/trpc/client"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
|
||||
import useRouterTransitionStore from "@/stores/router-transition"
|
||||
import useTrackingStore from "@/stores/tracking"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user