Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,42 +1,42 @@
|
||||
'use client'
|
||||
"use client"
|
||||
|
||||
import NextLink from 'next/link'
|
||||
import { type ReadonlyURLSearchParams, useSearchParams } from 'next/navigation'
|
||||
import { memo, useState } from 'react'
|
||||
import { useFocusWithin } from 'react-aria'
|
||||
import { useIntl } from 'react-intl'
|
||||
import NextLink from "next/link"
|
||||
import { type ReadonlyURLSearchParams, useSearchParams } from "next/navigation"
|
||||
import { memo, useState } from "react"
|
||||
import { useFocusWithin } from "react-aria"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import {
|
||||
alternativeHotelsMap,
|
||||
selectHotelMap,
|
||||
selectRate,
|
||||
} from '@scandic-hotels/common/constants/routes/hotelReservation'
|
||||
import { getSingleDecimal } from '@scandic-hotels/common/utils/numberFormatting'
|
||||
import Caption from '../Caption'
|
||||
import { Divider } from '../Divider'
|
||||
import { FacilityToIcon } from '../FacilityToIcon'
|
||||
import HotelLogoIcon from '../Icons/Logos'
|
||||
import ImageGallery, { GalleryImage } from '../ImageGallery'
|
||||
import Link from '../OldDSLink'
|
||||
import { Typography } from '../Typography'
|
||||
import { HotelPointsRow } from './HotelPointsRow'
|
||||
import { NoPriceAvailableCard } from './NoPriceAvailableCard'
|
||||
} from "@scandic-hotels/common/constants/routes/hotelReservation"
|
||||
import { getSingleDecimal } from "@scandic-hotels/common/utils/numberFormatting"
|
||||
import Caption from "../Caption"
|
||||
import { Divider } from "../Divider"
|
||||
import { FacilityToIcon } from "../FacilityToIcon"
|
||||
import HotelLogoIcon from "../Icons/Logos"
|
||||
import ImageGallery, { GalleryImage } from "../ImageGallery"
|
||||
import Link from "../OldDSLink"
|
||||
import { Typography } from "../Typography"
|
||||
import { HotelPointsRow } from "./HotelPointsRow"
|
||||
import { NoPriceAvailableCard } from "./NoPriceAvailableCard"
|
||||
|
||||
import HotelChequeCard from './HotelChequeCard'
|
||||
import { HotelPriceCard } from './HotelPriceCard'
|
||||
import HotelVoucherCard from './HotelVoucherCard'
|
||||
import { hotelCardVariants } from './variants'
|
||||
import HotelChequeCard from "./HotelChequeCard"
|
||||
import { HotelPriceCard } from "./HotelPriceCard"
|
||||
import HotelVoucherCard from "./HotelVoucherCard"
|
||||
import { hotelCardVariants } from "./variants"
|
||||
|
||||
import styles from './hotelCard.module.css'
|
||||
import styles from "./hotelCard.module.css"
|
||||
|
||||
import { CurrencyEnum } from '@scandic-hotels/common/constants/currency'
|
||||
import { FacilityEnum } from '@scandic-hotels/common/constants/facilities'
|
||||
import { HotelType } from '@scandic-hotels/common/constants/hotelType'
|
||||
import type { Lang } from '@scandic-hotels/common/constants/language'
|
||||
import { RateTypeEnum } from '@scandic-hotels/common/constants/rateType'
|
||||
import { BookingCodeChip } from '../BookingCodeChip'
|
||||
import { FakeButton } from '../FakeButton'
|
||||
import { TripAdvisorChip } from '../TripAdvisorChip'
|
||||
import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
||||
import { FacilityEnum } from "@scandic-hotels/common/constants/facilities"
|
||||
import { HotelType } from "@scandic-hotels/common/constants/hotelType"
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import { RateTypeEnum } from "@scandic-hotels/common/constants/rateType"
|
||||
import { BookingCodeChip } from "../BookingCodeChip"
|
||||
import { FakeButton } from "../FakeButton"
|
||||
import { TripAdvisorChip } from "../TripAdvisorChip"
|
||||
|
||||
type Price = {
|
||||
pricePerStay: number
|
||||
@@ -104,8 +104,8 @@ export type HotelCardProps = {
|
||||
images: GalleryImage[]
|
||||
distanceToCityCenter: number
|
||||
isUserLoggedIn: boolean
|
||||
type?: 'mapListing' | 'pageListing'
|
||||
state?: 'default' | 'active'
|
||||
type?: "mapListing" | "pageListing"
|
||||
state?: "default" | "active"
|
||||
bookingCode?: string | null
|
||||
isAlternative?: boolean
|
||||
isPartnerBrand: boolean
|
||||
@@ -129,9 +129,9 @@ export const HotelCardComponent = memo(
|
||||
hotel,
|
||||
distanceToCityCenter,
|
||||
isUserLoggedIn,
|
||||
state = 'default',
|
||||
type = 'pageListing',
|
||||
bookingCode = '',
|
||||
state = "default",
|
||||
type = "pageListing",
|
||||
bookingCode = "",
|
||||
isAlternative,
|
||||
isPartnerBrand,
|
||||
pointsCurrency,
|
||||
@@ -179,8 +179,8 @@ export const HotelCardComponent = memo(
|
||||
(r) => r.hasEnoughPoints
|
||||
)
|
||||
const notEnoughPointsLabel = intl.formatMessage({
|
||||
id: 'booking.notEnoughPoints',
|
||||
defaultMessage: 'Not enough points',
|
||||
id: "booking.notEnoughPoints",
|
||||
defaultMessage: "Not enough points",
|
||||
})
|
||||
|
||||
const isDisabled = prices?.redemptions?.length && hasInsufficientPoints
|
||||
@@ -230,12 +230,12 @@ export const HotelCardComponent = memo(
|
||||
</Typography>
|
||||
<div className={styles.addressContainer}>
|
||||
<address className={styles.address}>
|
||||
{type == 'mapListing' && (
|
||||
{type == "mapListing" && (
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
<p>{addressStr}</p>
|
||||
</Typography>
|
||||
)}
|
||||
{type === 'pageListing' && (
|
||||
{type === "pageListing" && (
|
||||
<Link
|
||||
size="small"
|
||||
textDecoration="underline"
|
||||
@@ -243,8 +243,8 @@ export const HotelCardComponent = memo(
|
||||
href={mapUrl}
|
||||
keepSearchParams
|
||||
aria-label={intl.formatMessage({
|
||||
id: 'destination.seeOnMap',
|
||||
defaultMessage: 'See on map',
|
||||
id: "destination.seeOnMap",
|
||||
defaultMessage: "See on map",
|
||||
})}
|
||||
>
|
||||
<Typography variant="Body/Supporting text (caption)/smRegular">
|
||||
@@ -261,8 +261,8 @@ export const HotelCardComponent = memo(
|
||||
<span>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: 'common.kmToCityCenter',
|
||||
defaultMessage: '{number} km to city center',
|
||||
id: "common.kmToCityCenter",
|
||||
defaultMessage: "{number} km to city center",
|
||||
},
|
||||
{
|
||||
number: getSingleDecimal(distanceToCityCenter / 1000),
|
||||
@@ -343,8 +343,8 @@ export const HotelCardComponent = memo(
|
||||
<div className={styles.pointsCard}>
|
||||
<Caption>
|
||||
{intl.formatMessage({
|
||||
id: 'hotelCard.availableRates',
|
||||
defaultMessage: 'Available rates',
|
||||
id: "hotelCard.availableRates",
|
||||
defaultMessage: "Available rates",
|
||||
})}
|
||||
</Caption>
|
||||
{prices.redemptions.map((redemption) => (
|
||||
@@ -371,8 +371,8 @@ export const HotelCardComponent = memo(
|
||||
{isDisabled
|
||||
? notEnoughPointsLabel
|
||||
: intl.formatMessage({
|
||||
id: 'common.seeRooms',
|
||||
defaultMessage: 'See rooms',
|
||||
id: "common.seeRooms",
|
||||
defaultMessage: "See rooms",
|
||||
})}
|
||||
</FakeButton>
|
||||
</>
|
||||
@@ -415,11 +415,11 @@ function PricesWrapper({
|
||||
}
|
||||
|
||||
const params = new URLSearchParams(searchParams)
|
||||
params.delete('city')
|
||||
params.set('hotel', hotelId)
|
||||
params.delete("city")
|
||||
params.set("hotel", hotelId)
|
||||
|
||||
if (removeBookingCodeFromSearchParams) {
|
||||
params.delete('bookingCode')
|
||||
params.delete("bookingCode")
|
||||
}
|
||||
|
||||
const href = `${pathname}?${params.toString()}`
|
||||
|
||||
Reference in New Issue
Block a user