update to new geo hook
This commit is contained in:
@@ -8,9 +8,9 @@ import {
|
||||
INTERNATIONAL_TELEPHONE_CODES,
|
||||
} from '#/lib/international-telephone-codes'
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {useGeolocationStatus} from '#/state/geolocation'
|
||||
import {atoms as a, web} from '#/alf'
|
||||
import * as Select from '#/components/Select'
|
||||
import {useGeolocation} from '#/geolocation'
|
||||
|
||||
/**
|
||||
* Country picker for a phone number input
|
||||
@@ -26,7 +26,7 @@ export function InternationalPhoneCodeSelect({
|
||||
onChange: (value: string) => void
|
||||
}) {
|
||||
const {_, i18n} = useLingui()
|
||||
const {location} = useGeolocationStatus()
|
||||
const location = useGeolocation()
|
||||
|
||||
const defaultCountry = useMemo(() => {
|
||||
return getDefaultCountry(location)
|
||||
|
||||
@@ -2,7 +2,6 @@ import React from 'react'
|
||||
import {type TextInput, View} from 'react-native'
|
||||
|
||||
import {getDefaultCountry} from '#/lib/international-telephone-codes'
|
||||
import {useGeolocationStatus} from '#/state/geolocation'
|
||||
import {atoms as a} from '#/alf'
|
||||
import {Button, ButtonText} from '#/components/Button'
|
||||
import {DateField, LabelText} from '#/components/forms/DateField'
|
||||
@@ -13,6 +12,7 @@ import * as ToggleButton from '#/components/forms/ToggleButton'
|
||||
import {Globe_Stroke2_Corner0_Rounded as Globe} from '#/components/icons/Globe'
|
||||
import {InternationalPhoneCodeSelect} from '#/components/InternationalPhoneCodeSelect'
|
||||
import {H1, H3} from '#/components/Typography'
|
||||
import {useGeolocation} from '#/geolocation'
|
||||
|
||||
export function Forms() {
|
||||
const [toggleGroupAValues, setToggleGroupAValues] = React.useState(['a'])
|
||||
@@ -26,7 +26,7 @@ export function Forms() {
|
||||
const [value, setValue] = React.useState('')
|
||||
const [date, setDate] = React.useState('2001-01-01')
|
||||
|
||||
const {location} = useGeolocationStatus()
|
||||
const location = useGeolocation()
|
||||
const [telCode, setTelCode] = React.useState(() =>
|
||||
getDefaultCountry(location),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user