| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * |
| 7 | * @flow |
| 8 | */ |
| 9 | |
| 10 | import * as React from 'react'; |
| 11 | import useThemeStyles from './useThemeStyles'; |
| 12 | |
| 13 | export default function ThemeProvider({ |
| 14 | children, |
| 15 | }: { |
| 16 | children: React.Node, |
| 17 | }): React.Node { |
| 18 | const themeStyle = useThemeStyles(); |
| 19 | |
| 20 | const style = React.useMemo(() => { |
| 21 | return { |
| 22 | ...themeStyle, |
| 23 | width: '100%', |
| 24 | height: '100%', |
| 25 | }; |
| 26 | }, [themeStyle]); |
| 27 | |
| 28 | return <div style={style}>{children}</div>; |
| 29 | } |