diff --git a/apps/quick-dapp/src/App.tsx b/apps/quick-dapp/src/App.tsx index 5adacb2e2f..c01f92bb7d 100644 --- a/apps/quick-dapp/src/App.tsx +++ b/apps/quick-dapp/src/App.tsx @@ -1,4 +1,5 @@ -import React, { useEffect, useReducer } from 'react'; +import React, { useEffect, useReducer, useState } from 'react'; +import { IntlProvider } from 'react-intl' import CreateInstance from './components/CreateInstance'; import EditInstance from './components/EditInstance'; import DeployPanel from './components/DeployPanel'; @@ -15,6 +16,10 @@ import remixClient from './remix-client'; import './App.css'; function App(): JSX.Element { + const [locale, setLocale] = useState<{code: string; messages: any}>({ + code: 'en', + messages: null, + }) const [appState, dispatch] = useReducer(appReducer, appInitialState); useEffect(() => { updateState(appState); @@ -29,6 +34,14 @@ function App(): JSX.Element { remixClient.on('theme', 'themeChanged', (theme: any) => { selectTheme(theme.name); }); + // @ts-ignore + remixClient.call('locale', 'currentLocale').then((locale: any) => { + setLocale(locale) + }) + // @ts-ignore + remixClient.on('locale', 'localeChanged', (locale: any) => { + setLocale(locale) + }) }); }, []); return ( @@ -38,17 +51,19 @@ function App(): JSX.Element { appState, }} > - {Object.keys(appState.instance.abi).length > 0 ? ( -