Merged in chore/SW-3145-move-country (pull request #2545)
chore: SW-3145 Moved country into design system * chore: SW-3145 Moved country into design system Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -18,7 +18,7 @@ import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking"
|
||||
|
||||
import Modal from "@/components/Modal"
|
||||
import Input from "@/components/TempDesignSystem/Form/Input"
|
||||
import { getErrorMessage } from "@/components/TempDesignSystem/Form/Input/errors"
|
||||
import { getErrorMessage } from "@/utils/getErrorMessage"
|
||||
|
||||
import { Input as BookingWidgetInput } from "../Input"
|
||||
import { isMultiRoomError } from "../utils"
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking"
|
||||
|
||||
import Modal from "@/components/Modal"
|
||||
import { getErrorMessage } from "@/components/TempDesignSystem/Form/Input/errors"
|
||||
import { getErrorMessage } from "@/utils/getErrorMessage"
|
||||
|
||||
import { RemoveExtraRooms } from "../BookingCode"
|
||||
import { isMultiRoomError } from "../utils"
|
||||
|
||||
@@ -3,17 +3,21 @@
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
import CountrySelect from "@scandic-hotels/design-system/Form/Country"
|
||||
import { Select } from "@scandic-hotels/design-system/Select"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { getLocalizedLanguageOptions } from "@/constants/languages"
|
||||
|
||||
import CountrySelect from "@/components/TempDesignSystem/Form/Country"
|
||||
import DateSelect from "@/components/TempDesignSystem/Form/Date"
|
||||
import Input from "@/components/TempDesignSystem/Form/Input"
|
||||
import PasswordInput from "@/components/TempDesignSystem/Form/PasswordInput"
|
||||
import Phone from "@/components/TempDesignSystem/Form/Phone"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { getFormattedCountryList } from "@/utils/countries"
|
||||
import { getErrorMessage } from "@/utils/getErrorMessage"
|
||||
|
||||
import { editProfileErrors } from "../schema"
|
||||
|
||||
import styles from "./formContent.module.css"
|
||||
|
||||
@@ -59,9 +63,15 @@ export default function FormContent() {
|
||||
registerOptions={{ required: true }}
|
||||
/>
|
||||
<CountrySelect
|
||||
countries={getFormattedCountryList(intl)}
|
||||
errorMessage={getErrorMessage(
|
||||
intl,
|
||||
editProfileErrors.COUNTRY_REQUIRED
|
||||
)}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Country",
|
||||
})}
|
||||
lang={lang}
|
||||
name="address.countryCode"
|
||||
registerOptions={{ required: true }}
|
||||
/>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { useIntl } from "react-intl"
|
||||
import { logger } from "@scandic-hotels/common/logger"
|
||||
import { Button } from "@scandic-hotels/design-system/Button"
|
||||
import Checkbox from "@scandic-hotels/design-system/Form/Checkbox"
|
||||
import CountrySelect from "@scandic-hotels/design-system/Form/Country"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import {
|
||||
@@ -23,7 +24,6 @@ import {
|
||||
privacyPolicy,
|
||||
} from "@/constants/webHrefs"
|
||||
|
||||
import CountrySelect from "@/components/TempDesignSystem/Form/Country"
|
||||
import DateSelect from "@/components/TempDesignSystem/Form/Date"
|
||||
import Input from "@/components/TempDesignSystem/Form/Input"
|
||||
import PasswordInput from "@/components/TempDesignSystem/Form/PasswordInput"
|
||||
@@ -32,6 +32,8 @@ import Link from "@/components/TempDesignSystem/Link"
|
||||
import { toast } from "@/components/TempDesignSystem/Toasts"
|
||||
import { useFormTracking } from "@/components/TrackingSDK/hooks"
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { getFormattedCountryList } from "@/utils/countries"
|
||||
import { getErrorMessage } from "@/utils/getErrorMessage"
|
||||
import { formatPhoneNumber } from "@/utils/phone"
|
||||
|
||||
// import { type SignUpSchema, signUpSchema } from "./schema"
|
||||
@@ -169,9 +171,15 @@ export default function SignupForm({ title }: SignUpFormProps) {
|
||||
registerOptions={{ required: true }}
|
||||
/>
|
||||
<CountrySelect
|
||||
countries={getFormattedCountryList(intl)}
|
||||
errorMessage={getErrorMessage(
|
||||
intl,
|
||||
signupErrors.COUNTRY_REQUIRED
|
||||
)}
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Country",
|
||||
})}
|
||||
lang={lang}
|
||||
name="address.countryCode"
|
||||
registerOptions={{ required: true }}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user