wip: new PhoneCountryCode Select
This commit is contained in:
committed by
Michael Zetterberg
parent
5f12dedb50
commit
79e669020a
@@ -0,0 +1,25 @@
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { Select } from "@scandic-hotels/design-system/Select"
|
||||
|
||||
import { countryPhoneCodes } from "@/constants/countryPhoneCodes"
|
||||
|
||||
export default function PhoneCountryCode() {
|
||||
const intl = useIntl()
|
||||
const countries = Object.entries(countryPhoneCodes).map(
|
||||
([countryName, countryCode]) => ({
|
||||
label: countryName,
|
||||
value: countryCode,
|
||||
})
|
||||
)
|
||||
console.log("length: ", countries.length)
|
||||
return (
|
||||
<Select
|
||||
name="phoneCountryCode"
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Country code",
|
||||
})}
|
||||
items={countries}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import Input from "@/components/TempDesignSystem/Form/Input"
|
||||
|
||||
export default function PhoneNumber() {
|
||||
const intl = useIntl()
|
||||
return (
|
||||
<Input
|
||||
label={intl.formatMessage({
|
||||
defaultMessage: "Phone number",
|
||||
})}
|
||||
name="phoneNumber"
|
||||
type="tel"
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user