@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
20 lines (19 loc) • 770 B
JavaScript
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';`
var defaultFontSize = 14;
export function BaseThemeWrapper(_ref) {
var baseFontSize = _ref.baseFontSize,
children = _ref.children;
var memoizedTheme = useMemo(function () {
return {
baseFontSize: baseFontSize || defaultFontSize,
layoutMaxWidth: akEditorDefaultLayoutWidth
};
}, [baseFontSize]);
return /*#__PURE__*/React.createElement(ThemeProvider, {
theme: memoizedTheme
}, children);
}