feat: rename form/card to form/choicecard

This commit is contained in:
Simon Emanuelsson
2024-10-08 11:06:09 +02:00
committed by Pontus Dreij
parent 94a1aa625a
commit ee6a40a553
8 changed files with 21 additions and 23 deletions

View File

@@ -5,7 +5,7 @@ import { FormProvider, useForm } from "react-hook-form"
import { useIntl } from "react-intl"
import { KingBedIcon } from "@/components/Icons"
import RadioCard from "@/components/TempDesignSystem/Form/Card/Radio"
import RadioCard from "@/components/TempDesignSystem/Form/ChoiceCard/Radio"
import { bedTypeSchema } from "./schema"
@@ -24,9 +24,7 @@ export default function BedType() {
reValidateMode: "onChange",
})
// @ts-expect-error - Types mismatch docs as this is
// a pattern that is allowed https://formatjs.io/docs/react-intl/api#usage
const text = intl.formatMessage(
const text = intl.formatMessage<React.ReactNode>(
{ id: "<b>Included</b> (based on availability)" },
{ b: (str) => <b>{str}</b> }
)

View File

@@ -5,7 +5,7 @@ import { FormProvider, useForm } from "react-hook-form"
import { useIntl } from "react-intl"
import { BreakfastIcon, NoBreakfastIcon } from "@/components/Icons"
import RadioCard from "@/components/TempDesignSystem/Form/Card/Radio"
import RadioCard from "@/components/TempDesignSystem/Form/ChoiceCard/Radio"
import { breakfastSchema } from "./schema"
@@ -31,9 +31,7 @@ export default function Breakfast() {
Icon={BreakfastIcon}
id={breakfastEnum.BREAKFAST}
name="breakfast"
// @ts-expect-error - Types mismatch docs as this is
// a pattern that is allowed https://formatjs.io/docs/react-intl/api#usage
subtitle={intl.formatMessage(
subtitle={intl.formatMessage<React.ReactNode>(
{ id: "<b>{amount} {currency}</b>/night per adult" },
{
amount: "150",

View File

@@ -4,7 +4,7 @@ import { FormProvider, useForm } from "react-hook-form"
import { useIntl } from "react-intl"
import Button from "@/components/TempDesignSystem/Button"
import CheckboxCard from "@/components/TempDesignSystem/Form/Card/Checkbox"
import CheckboxCard from "@/components/TempDesignSystem/Form/ChoiceCard/Checkbox"
import CountrySelect from "@/components/TempDesignSystem/Form/Country"
import Input from "@/components/TempDesignSystem/Form/Input"
import Phone from "@/components/TempDesignSystem/Form/Phone"
@@ -88,8 +88,9 @@ export default function Details({ user }: DetailsProps) {
<footer className={styles.footer}>
{user ? null : (
<CheckboxCard
highlightSubtitle
list={list}
saving
name="join"
subtitle={intl.formatMessage(
{
id: "{difference}{amount} {currency}",