fix: Flow, remove misused withTranslation on functional component
This commit is contained in:
@ -3,12 +3,7 @@ import { find } from "lodash";
|
|||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { BackIcon, EmailIcon } from "outline-icons";
|
import { BackIcon, EmailIcon } from "outline-icons";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import {
|
import { Trans, useTranslation } from "react-i18next";
|
||||||
Trans,
|
|
||||||
withTranslation,
|
|
||||||
type TFunction,
|
|
||||||
useTranslation,
|
|
||||||
} from "react-i18next";
|
|
||||||
import { Link, type Location, Redirect } from "react-router-dom";
|
import { Link, type Location, Redirect } from "react-router-dom";
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import { setCookie } from "tiny-cookie";
|
import { setCookie } from "tiny-cookie";
|
||||||
@ -29,12 +24,11 @@ import useStores from "hooks/useStores";
|
|||||||
|
|
||||||
type Props = {|
|
type Props = {|
|
||||||
location: Location,
|
location: Location,
|
||||||
t: TFunction,
|
|
||||||
|};
|
|};
|
||||||
|
|
||||||
function Login({ location, t }: Props) {
|
function Login({ location }: Props) {
|
||||||
const query = useQuery();
|
const query = useQuery();
|
||||||
const { i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
const { auth } = useStores();
|
const { auth } = useStores();
|
||||||
const { config } = auth;
|
const { config } = auth;
|
||||||
const [emailLinkSentTo, setEmailLinkSentTo] = React.useState("");
|
const [emailLinkSentTo, setEmailLinkSentTo] = React.useState("");
|
||||||
@ -278,4 +272,4 @@ const Centered = styled(Flex)`
|
|||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export default withTranslation()<Login>(observer(Login));
|
export default observer(Login);
|
||||||
|
@ -6,7 +6,7 @@ export function detectLanguage() {
|
|||||||
return `${ln}_${region}`;
|
return `${ln}_${region}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function changeLanguage(toLanguageString, i18n) {
|
export function changeLanguage(toLanguageString: ?string, i18n: any) {
|
||||||
if (toLanguageString && i18n.language !== toLanguageString) {
|
if (toLanguageString && i18n.language !== toLanguageString) {
|
||||||
// Languages are stored in en_US format in the database, however the
|
// Languages are stored in en_US format in the database, however the
|
||||||
// frontend translation framework (i18next) expects en-US
|
// frontend translation framework (i18next) expects en-US
|
||||||
|
Reference in New Issue
Block a user