UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

19 lines (18 loc) 702 B
import React, { useMemo } from 'react'; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766 import { ThemeProvider } from '@emotion/react'; import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles'; // Default value from: `import { fontSize } from '@atlaskit/theme/constants';` const defaultFontSize = 14; export function BaseThemeWrapper({ baseFontSize, children }) { const memoizedTheme = useMemo(() => ({ baseFontSize: baseFontSize || defaultFontSize, layoutMaxWidth: akEditorDefaultLayoutWidth }), [baseFontSize]); return /*#__PURE__*/React.createElement(ThemeProvider, { theme: memoizedTheme }, children); }