Skip to content
Snippets Groups Projects
Commit e22887cf authored by Marte Fossum's avatar Marte Fossum
Browse files

Merge branch 'GREG-238-prioriter-norge-landskoder' into 'master'

Set Norway default country code

See merge request !315
parents 1873005e 8bf928ab
No related branches found
No related tags found
1 merge request!315Set Norway default country code
Pipeline #126471 passed
......@@ -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',
}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment