Set language from URL.
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user