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,20 +1,20 @@
|
||||
'use client'
|
||||
"use client"
|
||||
|
||||
import { useIntl } from 'react-intl'
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { Typography } from '../../Typography'
|
||||
import { Typography } from "../../Typography"
|
||||
|
||||
import styles from './parkingList.module.css'
|
||||
import styles from "./parkingList.module.css"
|
||||
|
||||
import type { Parking } from '../parkingInformationTypes'
|
||||
import type { Parking } from "../parkingInformationTypes"
|
||||
|
||||
type ParkingListProps = Pick<
|
||||
Parking,
|
||||
| 'address'
|
||||
| 'canMakeReservation'
|
||||
| 'distanceToHotel'
|
||||
| 'numberOfChargingSpaces'
|
||||
| 'numberOfParkingSpots'
|
||||
| "address"
|
||||
| "canMakeReservation"
|
||||
| "distanceToHotel"
|
||||
| "numberOfChargingSpaces"
|
||||
| "numberOfParkingSpots"
|
||||
>
|
||||
|
||||
export default function ParkingList({
|
||||
@@ -27,12 +27,12 @@ export default function ParkingList({
|
||||
const intl = useIntl()
|
||||
|
||||
const canMakeReservationYesMsg = intl.formatMessage({
|
||||
id: 'parkingInformation.reservedInAdvanceYes',
|
||||
defaultMessage: 'Parking can be reserved in advance: Yes',
|
||||
id: "parkingInformation.reservedInAdvanceYes",
|
||||
defaultMessage: "Parking can be reserved in advance: Yes",
|
||||
})
|
||||
const canMakeReservationNoMsg = intl.formatMessage({
|
||||
id: 'parkingInformation.reservedInAdvanceNo',
|
||||
defaultMessage: 'Parking can be reserved in advance: No',
|
||||
id: "parkingInformation.reservedInAdvanceNo",
|
||||
defaultMessage: "Parking can be reserved in advance: No",
|
||||
})
|
||||
|
||||
return (
|
||||
@@ -42,9 +42,9 @@ export default function ParkingList({
|
||||
<li className={styles.listItem}>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: 'parkingInformation.numberOfChargingPoints',
|
||||
id: "parkingInformation.numberOfChargingPoints",
|
||||
defaultMessage:
|
||||
'Number of charging points for electric cars: {number}',
|
||||
"Number of charging points for electric cars: {number}",
|
||||
},
|
||||
{ number: numberOfChargingSpaces }
|
||||
)}
|
||||
@@ -59,8 +59,8 @@ export default function ParkingList({
|
||||
<li className={styles.listItem}>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: 'parkingInformation.numberOfParkingSpots',
|
||||
defaultMessage: 'Number of parking spots: {number}',
|
||||
id: "parkingInformation.numberOfParkingSpots",
|
||||
defaultMessage: "Number of parking spots: {number}",
|
||||
},
|
||||
{ number: numberOfParkingSpots }
|
||||
)}
|
||||
@@ -70,8 +70,8 @@ export default function ParkingList({
|
||||
<li className={styles.listItem}>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: 'parkingInformation.distanceToHotel',
|
||||
defaultMessage: 'Distance to hotel: {distanceInM} m',
|
||||
id: "parkingInformation.distanceToHotel",
|
||||
defaultMessage: "Distance to hotel: {distanceInM} m",
|
||||
},
|
||||
{ distanceInM: distanceToHotel }
|
||||
)}
|
||||
@@ -81,8 +81,8 @@ export default function ParkingList({
|
||||
<li className={styles.listItem}>
|
||||
{intl.formatMessage(
|
||||
{
|
||||
id: 'parkingInformation.address',
|
||||
defaultMessage: 'Address: {address}',
|
||||
id: "parkingInformation.address",
|
||||
defaultMessage: "Address: {address}",
|
||||
},
|
||||
{ address }
|
||||
)}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
gap: var(--Space-x1);
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
content: "";
|
||||
position: relative;
|
||||
top: 3px;
|
||||
display: inline-flex;
|
||||
@@ -17,7 +17,7 @@
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-color: var(--Icon-Accent);
|
||||
mask-image: url('/_static/shared/icons/heart.svg');
|
||||
mask-image: url("/_static/shared/icons/heart.svg");
|
||||
mask-size: contain;
|
||||
mask-repeat: no-repeat;
|
||||
}
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
'use client'
|
||||
"use client"
|
||||
|
||||
import { useIntl } from 'react-intl'
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { Typography } from '../../Typography'
|
||||
import { Typography } from "../../Typography"
|
||||
|
||||
import { formatPrice } from '@scandic-hotels/common/utils/numberFormatting'
|
||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
||||
|
||||
import { type Parking, ParkingPricePeriods } from '../parkingInformationTypes'
|
||||
import { getPeriod } from './utils'
|
||||
import { type Parking, ParkingPricePeriods } from "../parkingInformationTypes"
|
||||
import { getPeriod } from "./utils"
|
||||
|
||||
import styles from './parkingPrices.module.css'
|
||||
import styles from "./parkingPrices.module.css"
|
||||
|
||||
interface ParkingPricesProps
|
||||
extends Pick<Parking['pricing'], 'freeParking'>,
|
||||
Pick<NonNullable<Parking['pricing']['localCurrency']>, 'currency'> {
|
||||
pricing: NonNullable<Parking['pricing']['localCurrency']>['ordinary']
|
||||
extends
|
||||
Pick<Parking["pricing"], "freeParking">,
|
||||
Pick<NonNullable<Parking["pricing"]["localCurrency"]>, "currency"> {
|
||||
pricing: NonNullable<Parking["pricing"]["localCurrency"]>["ordinary"]
|
||||
}
|
||||
|
||||
export default function ParkingPrices({
|
||||
currency = '',
|
||||
currency = "",
|
||||
freeParking,
|
||||
pricing,
|
||||
}: ParkingPricesProps) {
|
||||
@@ -29,8 +30,8 @@ export default function ParkingPrices({
|
||||
<Typography variant="Body/Paragraph/mdBold">
|
||||
<p className={styles.wrapper}>
|
||||
{intl.formatMessage({
|
||||
id: 'parkingInformation.freeParking',
|
||||
defaultMessage: 'Free parking',
|
||||
id: "parkingInformation.freeParking",
|
||||
defaultMessage: "Free parking",
|
||||
})}
|
||||
</p>
|
||||
</Typography>
|
||||
@@ -45,13 +46,13 @@ export default function ParkingPrices({
|
||||
<div className={styles.period}>
|
||||
<div className={styles.information}>
|
||||
<Typography variant="Body/Paragraph/mdBold">
|
||||
<dt>{getPeriod(intl, 'Hour')}</dt>
|
||||
<dt>{getPeriod(intl, "Hour")}</dt>
|
||||
</Typography>
|
||||
<Typography variant="Body/Paragraph/mdRegular">
|
||||
<dd>
|
||||
{intl.formatMessage({
|
||||
id: 'parkingInformation.atACost',
|
||||
defaultMessage: 'At a cost',
|
||||
id: "parkingInformation.atACost",
|
||||
defaultMessage: "At a cost",
|
||||
})}
|
||||
</dd>
|
||||
</Typography>
|
||||
@@ -78,8 +79,8 @@ export default function ParkingPrices({
|
||||
<div className={styles.information}>
|
||||
<dt>
|
||||
{intl.formatMessage({
|
||||
id: 'common.from',
|
||||
defaultMessage: 'From',
|
||||
id: "common.from",
|
||||
defaultMessage: "From",
|
||||
})}
|
||||
</dt>
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import { ParkingPricePeriods } from '../parkingInformationTypes'
|
||||
import { ParkingPricePeriods } from "../parkingInformationTypes"
|
||||
|
||||
import type { IntlShape } from 'react-intl'
|
||||
import type { IntlShape } from "react-intl"
|
||||
|
||||
export function getPeriod(intl: IntlShape, period?: string) {
|
||||
switch (period) {
|
||||
case ParkingPricePeriods.hour:
|
||||
return intl.formatMessage({
|
||||
id: 'parkingInformation.pricePerHour',
|
||||
defaultMessage: 'Price per hour',
|
||||
id: "parkingInformation.pricePerHour",
|
||||
defaultMessage: "Price per hour",
|
||||
})
|
||||
case ParkingPricePeriods.day:
|
||||
return intl.formatMessage({
|
||||
id: 'parkingInformation.pricePerDay',
|
||||
defaultMessage: 'Price per day',
|
||||
id: "parkingInformation.pricePerDay",
|
||||
defaultMessage: "Price per day",
|
||||
})
|
||||
case ParkingPricePeriods.night:
|
||||
return intl.formatMessage({
|
||||
id: 'parkingInformation.pricePerNight',
|
||||
defaultMessage: 'Price per night',
|
||||
id: "parkingInformation.pricePerNight",
|
||||
defaultMessage: "Price per night",
|
||||
})
|
||||
case ParkingPricePeriods.allDay:
|
||||
return intl.formatMessage({
|
||||
id: 'parkingInformation.pricePer24Hours',
|
||||
defaultMessage: 'Price per 24 hours',
|
||||
id: "parkingInformation.pricePer24Hours",
|
||||
defaultMessage: "Price per 24 hours",
|
||||
})
|
||||
default:
|
||||
return period
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
'use client'
|
||||
"use client"
|
||||
|
||||
import { useIntl } from 'react-intl'
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import ButtonLink from '../ButtonLink'
|
||||
import { Divider } from '../Divider'
|
||||
import { MaterialIcon } from '../Icons/MaterialIcon'
|
||||
import { Typography } from '../Typography'
|
||||
import ParkingList from './ParkingList'
|
||||
import ParkingPrices from './ParkingPrices'
|
||||
import ButtonLink from "../ButtonLink"
|
||||
import { Divider } from "../Divider"
|
||||
import { MaterialIcon } from "../Icons/MaterialIcon"
|
||||
import { Typography } from "../Typography"
|
||||
import ParkingList from "./ParkingList"
|
||||
import ParkingPrices from "./ParkingPrices"
|
||||
|
||||
import styles from './parkingInformation.module.css'
|
||||
import styles from "./parkingInformation.module.css"
|
||||
|
||||
import type { Parking } from './parkingInformationTypes'
|
||||
import type { Parking } from "./parkingInformationTypes"
|
||||
|
||||
type ParkingInformationProps = {
|
||||
parking: Parking
|
||||
@@ -23,7 +23,7 @@ export default function ParkingInformation({
|
||||
showExternalParkingButton = true,
|
||||
}: ParkingInformationProps) {
|
||||
const intl = useIntl()
|
||||
const title = `${parking.type}${parking.name ? ` (${parking.name})` : ''}`
|
||||
const title = `${parking.type}${parking.name ? ` (${parking.name})` : ""}`
|
||||
|
||||
return (
|
||||
<div className={styles.parkingInformation}>
|
||||
@@ -43,8 +43,8 @@ export default function ParkingInformation({
|
||||
<Typography variant="Body/Paragraph/mdBold">
|
||||
<h5 className={styles.heading}>
|
||||
{intl.formatMessage({
|
||||
id: 'parkingInformation.prices',
|
||||
defaultMessage: 'Prices',
|
||||
id: "parkingInformation.prices",
|
||||
defaultMessage: "Prices",
|
||||
})}
|
||||
</h5>
|
||||
</Typography>
|
||||
@@ -52,8 +52,8 @@ export default function ParkingInformation({
|
||||
<Typography variant="Title/Overline/sm">
|
||||
<h6 className={styles.priceHeading}>
|
||||
{intl.formatMessage({
|
||||
id: 'parkingInformation.weekdayPrices',
|
||||
defaultMessage: 'Weekday prices',
|
||||
id: "parkingInformation.weekdayPrices",
|
||||
defaultMessage: "Weekday prices",
|
||||
})}
|
||||
</h6>
|
||||
</Typography>
|
||||
@@ -70,8 +70,8 @@ export default function ParkingInformation({
|
||||
<Typography variant="Title/Overline/sm">
|
||||
<h6 className={styles.priceHeading}>
|
||||
{intl.formatMessage({
|
||||
id: 'parkingInformation.weekendPrices',
|
||||
defaultMessage: 'Weekend prices',
|
||||
id: "parkingInformation.weekendPrices",
|
||||
defaultMessage: "Weekend prices",
|
||||
})}
|
||||
</h6>
|
||||
</Typography>
|
||||
@@ -88,8 +88,8 @@ export default function ParkingInformation({
|
||||
{parking.externalParkingUrl && showExternalParkingButton && (
|
||||
<ButtonLink size="md" href={parking.externalParkingUrl} target="_blank">
|
||||
{intl.formatMessage({
|
||||
id: 'parkingInformation.bookParking',
|
||||
defaultMessage: 'Book parking',
|
||||
id: "parkingInformation.bookParking",
|
||||
defaultMessage: "Book parking",
|
||||
})}
|
||||
<MaterialIcon icon="open_in_new" color="CurrentColor" />
|
||||
</ButtonLink>
|
||||
|
||||
@@ -28,8 +28,8 @@ export type Parking = {
|
||||
}
|
||||
|
||||
export enum ParkingPricePeriods {
|
||||
allDay = 'AllDay',
|
||||
hour = 'Hour',
|
||||
day = 'Day',
|
||||
night = 'Night',
|
||||
allDay = "AllDay",
|
||||
hour = "Hour",
|
||||
day = "Day",
|
||||
night = "Night",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user