Skip to content
Snippets Groups Projects

Set Norway default country code

Merged Marte Fossum requested to merge GREG-238-prioriter-norge-landskoder into master
@@ -63,7 +63,7 @@ const GuestRegisterStep = forwardRef(
// components directly to the form-field using useForm
const [countryCode, setCountryCode] = useState<
CountryCallingCode | undefined
>(undefined)
>('NO')
const [passportNationality, setPassportNationality] = useState<
string | undefined
>(undefined)
@@ -124,11 +124,6 @@ const GuestRegisterStep = forwardRef(
console.log('trigger result is', result)
const tohandler = data
// Both mobilePhone and mobilePhoneCountry must be set
if (!data.mobilePhoneCountry || !data.mobilePhone) {
setPhoneErrorState(t('validation.phoneNumberAndCountryCode'))
return
}
// Phone checks passed, clear error message
setPhoneErrorState('')
@@ -502,7 +497,7 @@ const GuestRegisterStep = forwardRef(
>
<Select
sx={{
maxHeight: '2.5rem',
maxHeight: '2.65rem',
minWidth: '5rem',
marginRight: '0.5rem',
}}
@@ -511,7 +506,7 @@ const GuestRegisterStep = forwardRef(
displayEmpty
onChange={handleCountryCodeChange}
label={t('input.countryCallingCode')}
value={countryCode ? countryCode.toString() : ''}
value={countryCode ? countryCode.toString() : 'NO'}
renderValue={(selected: any) => {
if (!selected || selected.length === 0) {
return t('input.countryCallingCode')
@@ -526,9 +521,6 @@ const GuestRegisterStep = forwardRef(
'data-testid': 'phone-country-code-select-inner',
}}
>
<MenuItem disabled value="">
{t('input.countryCallingCode')}
</MenuItem>
{sortedPhoneCountries.map((country) => (
<MenuItem key={country[0]} value={country[0]}>
{country[1]} ({country[2]})
@@ -605,7 +597,7 @@ const GuestRegisterStep = forwardRef(
>
<Select
sx={{
maxHeight: '2.5rem',
maxHeight: '2.65rem',
minWidth: '5rem',
marginRight: '0.5rem',
}}
Loading