mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-16 12:38:19 -04:00
Use locale to infer user spoken language
This commit is contained in:
@@ -28,7 +28,7 @@ export const initialRequiredState = {
|
||||
city: '',
|
||||
pinned_url: '',
|
||||
photo_urls: [],
|
||||
languages: ['english'],
|
||||
languages: [],
|
||||
bio: null,
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {useProfileByUserId} from 'web/hooks/use-profile'
|
||||
import {ProfileWithoutUser} from 'common/profiles/profile'
|
||||
import {PageBase} from "web/components/page-base";
|
||||
import {SEO} from "web/components/SEO";
|
||||
import {useT} from 'web/lib/locale'
|
||||
import {useLocale, useT} from 'web/lib/locale'
|
||||
|
||||
export default function SignupPage() {
|
||||
const t = useT()
|
||||
@@ -55,9 +55,13 @@ export default function SignupPage() {
|
||||
}
|
||||
}, [user, holdLoading])
|
||||
|
||||
const {locale} = useLocale()
|
||||
const language = {en: 'english', fr: 'french'}[locale]
|
||||
|
||||
// Omit the id, created_time?
|
||||
const [profileForm, setProfileForm] = useState<ProfileWithoutUser>({
|
||||
...initialRequiredState,
|
||||
languages: language ? [language] : [],
|
||||
} as any)
|
||||
const setProfileState = (key: keyof ProfileWithoutUser, value: any) => {
|
||||
setProfileForm((prevState) => ({...prevState, [key]: value}))
|
||||
|
||||
Reference in New Issue
Block a user