Set language from URL.

This commit is contained in:
codevictory
2022-01-12 18:57:32 +02:00
parent 05d5e0400a
commit 4a15b4bf76
4 changed files with 38 additions and 3 deletions

View File

@@ -1,8 +1,17 @@
import { FormattedMessage } from 'react-intl';
import { Link } from 'react-router-dom';
import { Link, useLocation } from 'react-router-dom';
import { useSetRecoilState } from 'recoil';
import { currentLanguage } from '../atoms/language';
import './Confirmation.scss';
import { getLangFromSearch } from './utils';
export const Confirmation = () => {
const { search } = useLocation();
const setlang = useSetRecoilState(currentLanguage);
const lang = getLangFromSearch(search);
if (lang != '') setlang(lang);
return (
<div className='Confirmation'>
<h1>