From 06d861fb6fabac6a2fef8441ab3b3c6a7e1418b2 Mon Sep 17 00:00:00 2001 From: Christian Andolf Date: Fri, 14 Feb 2025 10:24:52 +0100 Subject: [PATCH] chore: add no unused vars lint rule --- .eslintrc.json | 15 ++++++++++++++- .../(payment-callback)/payment-callback/page.tsx | 3 +-- .../(standard)/alternative-hotels/map/page.tsx | 3 --- .../(standard)/select-rate/getValidDates.test.ts | 1 - .../(live-current)/current-content-page/page.tsx | 2 +- .../(protected)/sas-x-scandic/error/page.tsx | 1 - .../(sas)/(protected)/sas-x-scandic/layout.tsx | 1 - .../(sas)/(protected)/sas-x-scandic/link/page.tsx | 1 - .../sas-x-scandic/link/success/page.tsx | 6 +----- .../(sas)/(protected)/sas-x-scandic/otp/page.tsx | 8 +++++--- app/[lang]/webview/[contentType]/[uid]/page.tsx | 2 +- app/api/web/add-card-callback/[lang]/route.ts | 2 -- app/api/web/revalidate/hotel/route.ts | 2 +- components/Blocks/Accordion/index.tsx | 3 --- .../Blocks/DynamicContent/HowItWorks/index.tsx | 5 ----- .../Points/EarnAndBurn/JourneyTable/Client.tsx | 13 +------------ .../Points/EarnAndBurn/JourneyTable/index.tsx | 15 +-------------- .../Rewards/Redeem/useRedeemFlow.ts | 3 --- .../DynamicContent/Rewards/RewardIcon/data.ts | 1 - .../DynamicContent/Stays/StayCard/index.tsx | 2 -- .../Map/MapContent/Marker/index.tsx | 2 +- .../HotelPage/SidePeeks/Activities/index.tsx | 4 ---- .../Header/MyPagesMobileDropdown/index.tsx | 2 -- components/Current/Header/TopMenu/index.tsx | 2 +- components/Current/Tracking.tsx | 6 +++--- .../BookingCode/TabletCodeInput/index.tsx | 2 -- .../FormContent/BookingCode/index.tsx | 7 ++----- .../BookingWidget/FormContent/Voucher/index.tsx | 2 -- components/Forms/BookingWidget/index.tsx | 2 +- components/Forms/BookingWidget/schema.ts | 2 +- components/Forms/Signup/index.tsx | 2 +- components/Header/MainMenu/MyPagesMenu/index.tsx | 2 -- .../Header/MainMenu/MyPagesMenuContent/index.tsx | 1 - .../BookingConfirmation/Receipt/index.tsx | 1 - .../Rooms/LinkedReservation/index.tsx | 10 ++-------- .../EnterDetails/Details/Signup/index.tsx | 1 - .../Details/SpecialRequests/index.tsx | 12 +----------- .../EnterDetails/SectionAccordion/index.tsx | 3 +-- .../MultiRoomWrapper/SelectedRoomPanel/index.tsx | 8 +------- .../Rooms/MultiRoomWrapper/index.tsx | 2 +- components/Lightbox/FullView.tsx | 2 +- .../Profile/ManagePreferencesButton/index.tsx | 2 +- components/SidePeeks/HotelSidePeek/index.tsx | 3 +-- components/Sidebar/JoinLoyalty/index.tsx | 2 -- .../TempDesignSystem/Form/NewPassword/index.tsx | 1 - i18n/dictionaries/da.json | 2 -- i18n/dictionaries/de.json | 2 -- i18n/dictionaries/en.json | 2 -- i18n/dictionaries/fi.json | 2 -- i18n/dictionaries/no.json | 2 -- i18n/dictionaries/sv.json | 2 -- lib/api/index.ts | 2 +- lib/graphql/request.ts | 2 +- types/components/form/signupForm.ts | 2 -- 54 files changed, 47 insertions(+), 143 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 9eeb76fca..be39b08df 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,6 +3,7 @@ "plugins": ["simple-import-sort", "@typescript-eslint"], "parser": "@typescript-eslint/parser", "rules": { + "no-unused-vars": "off", "react/function-component-definition": "error", "simple-import-sort/imports": [ "error", @@ -59,6 +60,18 @@ "prefer-inline": true } ], - "@typescript-eslint/consistent-type-imports": "error" + "@typescript-eslint/consistent-type-imports": "error", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "args": "all", + "argsIgnorePattern": "^_", + "caughtErrors": "all", + "caughtErrorsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "ignoreRestSiblings": true + } + ] } } diff --git a/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/page.tsx index a47196d51..5bbf565f0 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(payment-callback)/payment-callback/page.tsx @@ -11,7 +11,6 @@ import { import { serverClient } from "@/lib/trpc/server" import PaymentCallback from "@/components/HotelReservation/EnterDetails/Payment/PaymentCallback" -import { trackPaymentEvent } from "@/utils/tracking" import type { LangParams, PageArgs } from "@/types/params" @@ -62,7 +61,7 @@ export default async function PaymentCallbackPage({ ? error.errorCode.toString() : PaymentErrorCodeEnum.Failed.toString() ) - } catch (error) { + } catch { console.error( `[payment-callback] failed to get booking status for ${confirmationNumber}, status: ${status}` ) diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/map/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/map/page.tsx index 3d32d124d..dcd0034f5 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/map/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/alternative-hotels/map/page.tsx @@ -1,4 +1,3 @@ -import { notFound } from "next/navigation" import { Suspense } from "react" import { SelectHotelMapContainer } from "@/components/HotelReservation/SelectHotel/SelectHotelMap/SelectHotelMapContainer" @@ -6,8 +5,6 @@ import { SelectHotelMapContainerSkeleton } from "@/components/HotelReservation/S import { MapContainer } from "@/components/MapContainer" import { setLang } from "@/i18n/serverContext" -import { getHotelSearchDetails } from "../../utils" - import styles from "./page.module.css" import type { AlternativeHotelsSearchParams } from "@/types/components/hotelReservation/selectHotel/selectHotelSearchParams" diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/getValidDates.test.ts b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/getValidDates.test.ts index 61e162b02..64e91ea00 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/getValidDates.test.ts +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/getValidDates.test.ts @@ -3,7 +3,6 @@ import { beforeAll, describe, expect, it } from "@jest/globals" import { getValidFromDate, getValidToDate } from "./getValidDates" const NOW = new Date("2020-10-01T00:00:00Z") -let originalTz: string | undefined describe("getValidFromDate", () => { beforeAll(() => { diff --git a/app/[lang]/(live-current)/current-content-page/page.tsx b/app/[lang]/(live-current)/current-content-page/page.tsx index b0c60f8f5..4c5844002 100644 --- a/app/[lang]/(live-current)/current-content-page/page.tsx +++ b/app/[lang]/(live-current)/current-content-page/page.tsx @@ -62,7 +62,7 @@ export default async function CurrentContentPage({ ) - } catch (err) { + } catch { return notFound() } } diff --git a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/error/page.tsx b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/error/page.tsx index b9d362a77..350a22621 100644 --- a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/error/page.tsx +++ b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/error/page.tsx @@ -12,7 +12,6 @@ import type { LangParams, PageArgs, SearchParams } from "@/types/params" export default async function Page({ searchParams, - params, }: PageArgs & SearchParams<{ errorCode?: "dateOfBirthMismatch" }>) { const intl = await getIntl() diff --git a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/layout.tsx b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/layout.tsx index 483a949c1..7e7a707e3 100644 --- a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/layout.tsx +++ b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/layout.tsx @@ -3,7 +3,6 @@ import { ArrowLeft } from "react-feather" import { overview as profileOverview } from "@/constants/routes/myPages" import Image from "@/components/Image" -import { ProtectedLayout } from "@/components/ProtectedLayout" import Link from "@/components/TempDesignSystem/Link" import { getIntl } from "@/i18n" import background from "@/public/_static/img/partner/sas/sas_x_scandic_airplane_window_background.jpg" diff --git a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/page.tsx b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/page.tsx index 948819c2d..8dcc01c84 100644 --- a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/page.tsx +++ b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/page.tsx @@ -3,7 +3,6 @@ import React from "react" import { getProfileSafely } from "@/lib/trpc/memoizedRequests" -import { AlreadyLinkedError } from "../components/AlreadyLinkedError" import { SASModal } from "../components/SASModal" import { LinkAccountForm } from "./LinkAccountForm" diff --git a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/success/page.tsx b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/success/page.tsx index 1398c0687..a8f92f531 100644 --- a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/success/page.tsx +++ b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/success/page.tsx @@ -7,11 +7,7 @@ import { getIntl } from "@/i18n" import { SASModal } from "../../components/SASModal" -import type { LangParams, PageArgs } from "@/types/params" - -export default async function SASxScandicLinkPage({ - params, -}: PageArgs) { +export default async function SASxScandicLinkPage() { const intl = await getIntl() return ( diff --git a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/otp/page.tsx b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/otp/page.tsx index b6f2453d2..93c3b05f3 100644 --- a/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/otp/page.tsx +++ b/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/otp/page.tsx @@ -1,5 +1,5 @@ import { cookies } from "next/headers" -import { redirect, RedirectType } from "next/navigation" +import { redirect } from "next/navigation" import { z } from "zod" import { serverClient } from "@/lib/trpc/server" @@ -8,7 +8,9 @@ import { getIntl } from "@/i18n" import { safeTry } from "@/utils/safeTry" import { SAS_TOKEN_STORAGE_KEY } from "../sasUtils" -import OneTimePasswordForm, {type OnSubmitHandler } from "./OneTimePasswordForm" +import OneTimePasswordForm, { + type OnSubmitHandler, +} from "./OneTimePasswordForm" import type { LangParams, PageArgs, SearchParams } from "@/types/params" import type { Lang } from "@/constants/languages" @@ -125,7 +127,7 @@ function verifyTokenValidity(token: string | undefined) { const decoded = JSON.parse(atob(token.split(".")[1])) const expiry = decoded.exp * 1000 return Date.now() < expiry - } catch (error) { + } catch { return false } } diff --git a/app/[lang]/webview/[contentType]/[uid]/page.tsx b/app/[lang]/webview/[contentType]/[uid]/page.tsx index 6b658c28a..ecc2ec10b 100644 --- a/app/[lang]/webview/[contentType]/[uid]/page.tsx +++ b/app/[lang]/webview/[contentType]/[uid]/page.tsx @@ -47,7 +47,7 @@ export default async function ContentTypePage({ ) default: const u: never = user - console.log(`[webview:page] unhandled user loading error`) + console.log("[webview:page] unhandled user loading error", u) } } diff --git a/app/api/web/add-card-callback/[lang]/route.ts b/app/api/web/add-card-callback/[lang]/route.ts index bcbeff297..22c8361ff 100644 --- a/app/api/web/add-card-callback/[lang]/route.ts +++ b/app/api/web/add-card-callback/[lang]/route.ts @@ -1,5 +1,3 @@ -import { env } from "process" - import { Lang } from "@/constants/languages" import { profile } from "@/constants/routes/myPages" import { serverClient } from "@/lib/trpc/server" diff --git a/app/api/web/revalidate/hotel/route.ts b/app/api/web/revalidate/hotel/route.ts index 061e570cc..85ecf7f63 100644 --- a/app/api/web/revalidate/hotel/route.ts +++ b/app/api/web/revalidate/hotel/route.ts @@ -53,7 +53,7 @@ export async function POST(request: NextRequest) { let tag = "" if (content_type.uid === "hotel_page") { - const tag = generateHotelUrlTag(locale, entry.hotel_page_id) + tag = generateHotelUrlTag(locale, entry.hotel_page_id) } else { console.error( `Invalid content_type, received ${content_type.uid}, expected "hotel_page"` diff --git a/components/Blocks/Accordion/index.tsx b/components/Blocks/Accordion/index.tsx index c2d91afb4..8a26314cb 100644 --- a/components/Blocks/Accordion/index.tsx +++ b/components/Blocks/Accordion/index.tsx @@ -1,7 +1,6 @@ "use client" import { useState } from "react" -import { useIntl } from "react-intl" import JsonToHtml from "@/components/JsonToHtml" import SectionContainer from "@/components/Section/Container" @@ -17,8 +16,6 @@ import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation" import type { RTENode } from "@/types/transitionTypes/rte/node" export default function AccordionSection({ accordion, title }: AccordionProps) { - const intl = useIntl() - const showToggleButton = accordion.length > 5 const [allAccordionsVisible, setAllAccordionsVisible] = useState(!showToggleButton) diff --git a/components/Blocks/DynamicContent/HowItWorks/index.tsx b/components/Blocks/DynamicContent/HowItWorks/index.tsx index bd58526e6..df8568294 100644 --- a/components/Blocks/DynamicContent/HowItWorks/index.tsx +++ b/components/Blocks/DynamicContent/HowItWorks/index.tsx @@ -12,11 +12,6 @@ export default async function HowItWorks({ firstItem, }: HowItWorksProps) { const intl = await getIntl() - const displayHeader = !!( - dynamic_content.link || - dynamic_content.subtitle || - dynamic_content.title - ) return (
diff --git a/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/Client.tsx b/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/Client.tsx index 7bd58dd2e..9aa7e2fd1 100644 --- a/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/Client.tsx +++ b/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/Client.tsx @@ -10,16 +10,7 @@ import Pagination from "@/components/MyPages/Pagination" import ClientTable from "./ClientTable" -import type { Transactions } from "@/types/components/myPages/myPage/earnAndBurn" - -export default function TransactionTable({ - initialJourneyTransactions, -}: { - initialJourneyTransactions: { - data: { transactions: Transactions } - meta: { totalPages: number } - } -}) { +export default function TransactionTable() { const limit = 5 const [page, setPage] = useState(1) const { data, isFetching, isLoading } = @@ -29,8 +20,6 @@ export default function TransactionTable({ page, }, { - // TODO: fix the initial data issues on page load - // initialData: initialJourneyTransactions, placeholderData: keepPreviousData, } ) diff --git a/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/index.tsx b/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/index.tsx index 08acf2e1d..2bf170316 100644 --- a/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/index.tsx +++ b/components/Blocks/DynamicContent/Points/EarnAndBurn/JourneyTable/index.tsx @@ -1,18 +1,5 @@ -import { serverClient } from "@/lib/trpc/server" - import ClientJourney from "./Client" export default async function JourneyTable() { - const initialJourneyTransactions = - await serverClient().user.transaction.friendTransactions({ - page: 1, - limit: 5, - }) - if (!initialJourneyTransactions?.data) { - return null - } - - return ( - - ) + return } diff --git a/components/Blocks/DynamicContent/Rewards/Redeem/useRedeemFlow.ts b/components/Blocks/DynamicContent/Rewards/Redeem/useRedeemFlow.ts index 0c197a82b..d3abcdf66 100644 --- a/components/Blocks/DynamicContent/Rewards/Redeem/useRedeemFlow.ts +++ b/components/Blocks/DynamicContent/Rewards/Redeem/useRedeemFlow.ts @@ -4,8 +4,6 @@ import { createContext, useCallback, useContext, useEffect } from "react" import { trpc } from "@/lib/trpc/client" -import useLang from "@/hooks/useLang" - import type { RedeemFlowContext } from "@/types/components/myPages/myPage/accountPage" import type { RewardWithRedeem } from "@/server/routers/contentstack/reward/output" @@ -27,7 +25,6 @@ export default function useRedeemFlow() { timeRemaining, setTimeRemaining, } = useContext(RedeemContext) - const lang = useLang() const update = trpc.contentstack.rewards.redeem.useMutation<{ rewards: RewardWithRedeem[] diff --git a/components/Blocks/DynamicContent/Rewards/RewardIcon/data.ts b/components/Blocks/DynamicContent/Rewards/RewardIcon/data.ts index 11aedfc09..36d4823cf 100644 --- a/components/Blocks/DynamicContent/Rewards/RewardIcon/data.ts +++ b/components/Blocks/DynamicContent/Rewards/RewardIcon/data.ts @@ -53,7 +53,6 @@ function getIconForRewardId(rewardId: RewardId): IconName { return IconName.GiftOpen default: { - const unhandledRewardId: never = rewardId return IconName.GiftOpen } } diff --git a/components/Blocks/DynamicContent/Stays/StayCard/index.tsx b/components/Blocks/DynamicContent/Stays/StayCard/index.tsx index f6f2e3431..59c768156 100644 --- a/components/Blocks/DynamicContent/Stays/StayCard/index.tsx +++ b/components/Blocks/DynamicContent/Stays/StayCard/index.tsx @@ -1,7 +1,6 @@ "use client" import { useState } from "react" -import { useIntl } from "react-intl" import { dt } from "@/lib/dt" @@ -19,7 +18,6 @@ import type { StayCardProps } from "@/types/components/myPages/stays/stayCard" export default function StayCard({ stay }: StayCardProps) { const lang = useLang() - const intl = useIntl() // TODO: Temporary loading. Remove when current web is deleted. const [loading, setLoading] = useState(false) diff --git a/components/ContentType/DestinationPage/Map/MapContent/Marker/index.tsx b/components/ContentType/DestinationPage/Map/MapContent/Marker/index.tsx index e4caac171..5f6d44a25 100644 --- a/components/ContentType/DestinationPage/Map/MapContent/Marker/index.tsx +++ b/components/ContentType/DestinationPage/Map/MapContent/Marker/index.tsx @@ -25,7 +25,7 @@ export default function Marker({ properties, onMarkerClick, }: MarkerProps) { - const [markerRef, marker] = useAdvancedMarkerRef() + const [markerRef] = useAdvancedMarkerRef() const handleClick = useCallback(() => { if (onMarkerClick) { onMarkerClick(position, properties) diff --git a/components/ContentType/HotelPage/SidePeeks/Activities/index.tsx b/components/ContentType/HotelPage/SidePeeks/Activities/index.tsx index 10829456a..775377635 100644 --- a/components/ContentType/HotelPage/SidePeeks/Activities/index.tsx +++ b/components/ContentType/HotelPage/SidePeeks/Activities/index.tsx @@ -1,11 +1,8 @@ -import { activities } from "@/constants/routes/hotelPageParams" - import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" import SidePeek from "@/components/TempDesignSystem/SidePeek" import Preamble from "@/components/TempDesignSystem/Text/Preamble" import { getIntl } from "@/i18n" -import { getLang } from "@/i18n/serverContext" import styles from "./activities.module.css" @@ -16,7 +13,6 @@ export default async function ActivitiesSidePeek({ sidepeekCTA, sidepeekSlug, }: ActivitiesSidePeekProps) { - const lang = getLang() const intl = await getIntl() const { href, preamble } = contentPage return ( diff --git a/components/Current/Header/MyPagesMobileDropdown/index.tsx b/components/Current/Header/MyPagesMobileDropdown/index.tsx index 339014038..921adc522 100644 --- a/components/Current/Header/MyPagesMobileDropdown/index.tsx +++ b/components/Current/Header/MyPagesMobileDropdown/index.tsx @@ -19,8 +19,6 @@ import type { ReactNode } from "react" import { DropdownTypeEnum } from "@/types/components/dropdown/dropdown" export default function MyPagesMobileDropdown() { - const { data: myPagesNavigation } = useMyPagesNavigation() - const intl = useIntl() const { toggleDropdown, isMyPagesMobileMenuOpen } = useDropdownStore() diff --git a/components/Current/Header/TopMenu/index.tsx b/components/Current/Header/TopMenu/index.tsx index b54f01577..602f42350 100644 --- a/components/Current/Header/TopMenu/index.tsx +++ b/components/Current/Header/TopMenu/index.tsx @@ -89,7 +89,7 @@ export async function TopMenuSkeleton() {
    - {links.map((link, i) => ( + {links.map((_link, i) => (
  • diff --git a/components/Current/Tracking.tsx b/components/Current/Tracking.tsx index 8c2d33490..7470fd987 100644 --- a/components/Current/Tracking.tsx +++ b/components/Current/Tracking.tsx @@ -1,7 +1,7 @@ "use client" import { usePathname, useSearchParams } from "next/navigation" -import { useEffect, useState } from "react" +import { useEffect } from "react" import type { SiteSectionObject, @@ -19,7 +19,7 @@ function createPageObject(trackingData: TrackingData) { .filter((seg: string) => seg) function getSiteSections(segments: string[]): SiteSectionObject { - /* + /* Adobe expects the properties sitesection1 - sitessection6, hence the for-loop below The segments ['explore-scandic', 'wifi'] should result in: { @@ -29,7 +29,7 @@ function createPageObject(trackingData: TrackingData) { sitesection4: "explore-scandic|wifi||", sitesection5: "explore-scandic|wifi|||", sitesection6: "explore-scandic|wifi||||", - } + } */ const sitesections = {} as SiteSectionObject for (let i = 0; i < 6; i++) { diff --git a/components/Forms/BookingWidget/FormContent/BookingCode/TabletCodeInput/index.tsx b/components/Forms/BookingWidget/FormContent/BookingCode/TabletCodeInput/index.tsx index 10a7830dc..1be9f05d9 100644 --- a/components/Forms/BookingWidget/FormContent/BookingCode/TabletCodeInput/index.tsx +++ b/components/Forms/BookingWidget/FormContent/BookingCode/TabletCodeInput/index.tsx @@ -7,10 +7,8 @@ import type { BookingWidgetSchema } from "@/types/components/bookingWidget" export default function TabletCodeInput({ updateValue, - defaultValue, }: { updateValue: (val: string) => void - defaultValue?: string }) { const intl = useIntl() const { register } = useFormContext() diff --git a/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx b/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx index a8b2ea698..8b6fb1d1a 100644 --- a/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx +++ b/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx @@ -108,7 +108,7 @@ export default function BookingCode() { {({ close }) => (
    - +
    !prevVal) } @@ -43,7 +33,7 @@ export default function SpecialRequests() {
    - {/* + {/* TODO: Hiding because API is not ready for this yet (https://scandichotels.atlassian.net/browse/SW-1497). Add back in when API is ready. diff --git a/components/HotelReservation/EnterDetails/SectionAccordion/index.tsx b/components/HotelReservation/EnterDetails/SectionAccordion/index.tsx index f37e64143..d0800ba65 100644 --- a/components/HotelReservation/EnterDetails/SectionAccordion/index.tsx +++ b/components/HotelReservation/EnterDetails/SectionAccordion/index.tsx @@ -10,10 +10,9 @@ import { selectRoomStatus, } from "@/stores/enter-details/helpers" -import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "@/components/Icons" +import { CheckIcon, ChevronDownIcon } from "@/components/Icons" import Footnote from "@/components/TempDesignSystem/Text/Footnote" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import useScrollToActiveSection from "@/hooks/booking/useScrollToActiveSection" import styles from "./sectionAccordion.module.css" diff --git a/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx b/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx index 49e819c70..37debea76 100644 --- a/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx +++ b/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx @@ -16,13 +16,7 @@ import { isValidClientSession } from "@/utils/clientSession" import styles from "./selectedRoomPanel.module.css" -import type { Room as SelectedRateRoom } from "@/types/components/hotelReservation/selectRate/selectRate" - -interface SelectedRoomPanelProps { - room: SelectedRateRoom -} - -export default function SelectedRoomPanel({ room }: SelectedRoomPanelProps) { +export default function SelectedRoomPanel() { const intl = useIntl() const { data: session } = useSession() const isUserLoggedIn = isValidClientSession(session) diff --git a/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/index.tsx b/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/index.tsx index 9e62d9b9a..45a894e57 100644 --- a/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/index.tsx +++ b/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/index.tsx @@ -71,7 +71,7 @@ export default function MultiRoomWrapper({ )}
    - +
    {children}
    diff --git a/components/Lightbox/FullView.tsx b/components/Lightbox/FullView.tsx index 714a96f86..c6a316f08 100644 --- a/components/Lightbox/FullView.tsx +++ b/components/Lightbox/FullView.tsx @@ -86,7 +86,7 @@ export default function FullView({ transition={{ duration: 0.3 }} className={styles.fullViewImage} drag="x" - onDragEnd={(e, info) => handleSwipe(info.offset.x)} + onDragEnd={(_e, info) => handleSwipe(info.offset.x)} > {image.alt} { + onError: () => { toast.error( intl.formatMessage({ id: "An error occurred trying to manage your preferences, please try again later.", diff --git a/components/SidePeeks/HotelSidePeek/index.tsx b/components/SidePeeks/HotelSidePeek/index.tsx index c34d6f3f6..97dbc1579 100644 --- a/components/SidePeeks/HotelSidePeek/index.tsx +++ b/components/SidePeeks/HotelSidePeek/index.tsx @@ -22,7 +22,6 @@ export default function HotelSidePeek({ additionalHotelData, activeSidePeek, close, - showCTA, }: HotelSidePeekProps) { const intl = useIntl() const amenitiesList = hotel.detailedFacilities.filter( @@ -87,7 +86,7 @@ export default function HotelSidePeek({
    {/* TODO: handle linking to Hotel Page */} - {/* {showCTA && ( + {/* {showCTA && ( diff --git a/components/Sidebar/JoinLoyalty/index.tsx b/components/Sidebar/JoinLoyalty/index.tsx index d71c70c49..9c891d4af 100644 --- a/components/Sidebar/JoinLoyalty/index.tsx +++ b/components/Sidebar/JoinLoyalty/index.tsx @@ -1,5 +1,3 @@ -import { getName } from "@/lib/trpc/memoizedRequests" - import { auth } from "@/auth" import ArrowRight from "@/components/Icons/ArrowRight" import { ScandicFriends } from "@/components/Levels" diff --git a/components/TempDesignSystem/Form/NewPassword/index.tsx b/components/TempDesignSystem/Form/NewPassword/index.tsx index 69cfaecc2..95708cdef 100644 --- a/components/TempDesignSystem/Form/NewPassword/index.tsx +++ b/components/TempDesignSystem/Form/NewPassword/index.tsx @@ -29,7 +29,6 @@ export default function NewPassword({ disabled = false, placeholder = "", registerOptions = {}, - label, visibilityToggleable = true, }: NewPasswordProps) { const { control } = useFormContext() diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index cb27ed21f..16cd7a3d9 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -379,7 +379,6 @@ "No hotels match your filters": "Ingen rum matchede dine filtre.", "No matching location found": "Der blev ikke fundet nogen matchende placering", "No membership benefits applied": "No membership benefits applied", - "No preference": "Ingen præference", "No prices available": "Ingen tilgængelige priser", "No results": "Ingen resultater", "No transactions available": "Ingen tilgængelige transaktioner", @@ -592,7 +591,6 @@ "Upgrade your stay": "Opgrader dit ophold", "Use Bonus Cheque": "Brug Bonus Cheque", "Use bonus cheque": "Brug Bonus Cheque", - "Use code/voucher": "Brug kode/voucher", "User information": "Brugeroplysninger", "VAT": "VAT", "VAT amount": "VAT amount", diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 86ab4198a..c7865dc8d 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -380,7 +380,6 @@ "No hotels match your filters": "Kein Zimmer entspricht Ihren Filtern.", "No matching location found": "Kein passender Standort gefunden", "No membership benefits applied": "No membership benefits applied", - "No preference": "Keine Präferenz", "No prices available": "Keine Preise verfügbar", "No results": "Keine Ergebnisse", "No transactions available": "Keine Transaktionen verfügbar", @@ -592,7 +591,6 @@ "Upgrade your stay": "Werten Sie Ihren Aufenthalt auf", "Use Bonus Cheque": "Bonusscheck nutzen", "Use bonus cheque": "Bonusscheck nutzen", - "Use code/voucher": "Code/Gutschein nutzen", "User information": "Nutzerinformation", "VAT": "VAT", "VAT amount": "VAT amount", diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index d744cec6b..5293a4bd2 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -385,7 +385,6 @@ "No hotels match your filters": "No hotels match your filters", "No matching location found": "No matching location found", "No membership benefits applied": "No membership benefits applied", - "No preference": "No preference", "No prices available": "No prices available", "No results": "No results", "No transactions available": "No transactions available", @@ -598,7 +597,6 @@ "Upgrade your stay": "Upgrade your stay", "Use Bonus Cheque": "Use Bonus Cheque", "Use bonus cheque": "Use bonus cheque", - "Use code/voucher": "Use code/voucher", "User information": "User information", "VAT": "VAT", "VAT amount": "VAT amount", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index 8316b8a6e..d6eafdb04 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -379,7 +379,6 @@ "No hotels match your filters": "Yksikään huone ei vastannut suodattimiasi", "No matching location found": "Vastaavaa sijaintia ei löytynyt", "No membership benefits applied": "No membership benefits applied", - "No preference": "Ei toivetta", "No prices available": "Hintoja ei ole saatavilla", "No results": "Ei tuloksia", "No transactions available": "Ei tapahtumia saatavilla", @@ -592,7 +591,6 @@ "Upgrade your stay": "Päivitä oleskelusi", "Use Bonus Cheque": "Käytä bonussekkiä", "Use bonus cheque": "Käytä bonussekkiä", - "Use code/voucher": "Käytä koodia/voucheria", "User information": "Käyttäjän tiedot", "VAT": "VAT", "VAT amount": "VAT amount", diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index ed86b4b6a..e48e5ab44 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -378,7 +378,6 @@ "No hotels match your filters": "Ingen rom samsvarte med filtrene dine", "No matching location found": "Fant ingen samsvarende plassering", "No membership benefits applied": "No membership benefits applied", - "No preference": "Ingen preferanse", "No prices available": "Ingen priser tilgjengelig", "No results": "Ingen resultater", "No transactions available": "Ingen transaksjoner tilgjengelig", @@ -590,7 +589,6 @@ "Upgrade your stay": "Oppgrader oppholdet ditt", "Use Bonus Cheque": "Bruk bonussjekk", "Use bonus cheque": "Bruk bonussjekk", - "Use code/voucher": "Bruk kode/voucher", "User information": "Brukerinformasjon", "VAT": "VAT", "VAT amount": "VAT amount", diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index 37fcaeae0..4e9388f59 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -378,7 +378,6 @@ "No hotels match your filters": "Inga rum matchade dina filter", "No matching location found": "Ingen matchande plats hittades", "No membership benefits applied": "No membership benefits applied", - "No preference": "Ingen preferens", "No prices available": "Inga priser tillgängliga", "No results": "Inga resultat", "No transactions available": "Inga transaktioner tillgängliga", @@ -590,7 +589,6 @@ "Upgrade your stay": "Uppgradera din vistelse", "Use Bonus Cheque": "Använd bonuscheck", "Use bonus cheque": "Använd bonuscheck", - "Use code/voucher": "Använd kod/voucher", "User information": "Användarinformation", "VAT": "VAT", "VAT amount": "VAT amount", diff --git a/lib/api/index.ts b/lib/api/index.ts index 5842b5597..5fc1173c1 100644 --- a/lib/api/index.ts +++ b/lib/api/index.ts @@ -22,7 +22,7 @@ const defaultOptions: RequestInit = { const wrappedFetch = fetchRetry(fetch, { retries: 3, - retryDelay: function (attempt, error, response) { + retryDelay: function (attempt) { return Math.pow(2, attempt) * 150 // 150, 300, 600 }, }) diff --git a/lib/graphql/request.ts b/lib/graphql/request.ts index de4bc0bc0..6f3a51e18 100644 --- a/lib/graphql/request.ts +++ b/lib/graphql/request.ts @@ -27,7 +27,7 @@ export async function request( fetch: cache(async function (url: URL | RequestInfo, params?: RequestInit) { const wrappedFetch = fetchRetry(fetch, { retries: 3, - retryDelay: function (attempt, error, response) { + retryDelay: function (attempt) { return Math.pow(2, attempt) * 150 // 150, 300, 600 }, }) diff --git a/types/components/form/signupForm.ts b/types/components/form/signupForm.ts index 060c8d860..263aeb846 100644 --- a/types/components/form/signupForm.ts +++ b/types/components/form/signupForm.ts @@ -1,5 +1,3 @@ export type SignUpFormProps = { - link?: { href: string; text: string } - subtitle?: string title: string }