File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import { FunctionComponent } from "react"
5
5
import ReactDOMServer from "react-dom/server"
6
- import { IntlProvider } from "../react-components"
7
- import * as locales from "../locales"
6
+ import {
7
+ CustomTranslations ,
8
+ IntlProvider ,
9
+ SupportedTranslations ,
10
+ } from "../react-components"
8
11
9
- export type Context = {
10
- locale ?: keyof typeof locales
11
- }
12
+ export type Context = SupportedTranslations | CustomTranslations
12
13
13
14
export const ComponentWrapper = < Props extends { } > (
14
15
Component : FunctionComponent < Props > ,
15
16
props : Props ,
16
- { locale = "en" } : Context ,
17
+ ctx : Context ,
17
18
) => {
18
19
return ReactDOMServer . renderToStaticMarkup (
19
- < IntlProvider locale = { locale } >
20
+ < IntlProvider < typeof ctx > { ... ctx } >
20
21
< Component { ...props } />
21
22
</ IntlProvider > ,
22
23
)
You can’t perform that action at this time.
0 commit comments