excalidraw/src/components/InitializeApp.tsx
Kostas Bariotis 0a3fb70ec7
Dynamicaly import locales (#1793)
* dynamicly import locales

* fix tests

* reformat languages
2020-06-27 12:02:54 +01:00

25 lines
509 B
TypeScript

import React from "react";
import { LoadingMessage } from "./LoadingMessage";
import { setLanguageFirstTime } from "../i18n";
export class InitializeApp extends React.Component<
any,
{ isLoading: boolean }
> {
public state: { isLoading: boolean } = {
isLoading: true,
};
async componentDidMount() {
await setLanguageFirstTime();
this.setState({
isLoading: false,
});
}
public render() {
return this.state.isLoading ? <LoadingMessage /> : this.props.children;
}
}