diff options
author | Ricardo Cino <ricardo@cino.io> | 2022-06-22 00:32:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-21 22:32:18 +0000 |
commit | 73ba955e344c8ccedd43235495ef8b72b5a2b6fd (patch) | |
tree | 03766ab32fefe7e83026a14393527f1dcbaed849 /src/I18n.tsx | |
parent | docs: add cino as a contributor for infra [skip ci] (#330) (diff) | |
download | ferdium-app-73ba955e344c8ccedd43235495ef8b72b5a2b6fd.tar.gz ferdium-app-73ba955e344c8ccedd43235495ef8b72b5a2b6fd.tar.zst ferdium-app-73ba955e344c8ccedd43235495ef8b72b5a2b6fd.zip |
chore: Transform AppStore.js into Typescript (#329)
* turn actions into typescript
* correct tsconfig
* added TypedStore
Diffstat (limited to 'src/I18n.tsx')
-rw-r--r-- | src/I18n.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/I18n.tsx b/src/I18n.tsx index 0e63d1086..bf4b08cd1 100644 --- a/src/I18n.tsx +++ b/src/I18n.tsx | |||
@@ -10,7 +10,7 @@ const translations = generatedTranslations(); | |||
10 | 10 | ||
11 | type Props = { | 11 | type Props = { |
12 | stores: { | 12 | stores: { |
13 | app: typeof AppStore; | 13 | app: AppStore; |
14 | user: typeof UserStore; | 14 | user: typeof UserStore; |
15 | }; | 15 | }; |
16 | children: ReactNode; | 16 | children: ReactNode; |
@@ -21,14 +21,16 @@ class I18N extends Component<Props> { | |||
21 | window['ferdium'].menu.rebuild(); | 21 | window['ferdium'].menu.rebuild(); |
22 | } | 22 | } |
23 | 23 | ||
24 | render() { | 24 | render(): ReactNode { |
25 | const { stores, children } = this.props; | 25 | const { stores, children } = this.props; |
26 | const { locale } = stores.app; | 26 | const { locale } = stores.app; |
27 | return ( | 27 | return ( |
28 | <IntlProvider | 28 | <IntlProvider |
29 | {...{ locale, key: locale, messages: translations[locale] }} | 29 | {...{ locale, key: locale, messages: translations[locale] }} |
30 | ref={intlProvider => { | 30 | ref={intlProvider => { |
31 | window['ferdium'].intl = intlProvider ? intlProvider.state.intl : null; | 31 | window['ferdium'].intl = intlProvider |
32 | ? intlProvider.state.intl | ||
33 | : null; | ||
32 | }} | 34 | }} |
33 | > | 35 | > |
34 | {children} | 36 | {children} |