UNPKG

@sendbird/uikit-react-native-foundation

Version:

A foundational UI kit for building chat-enabled React Native apps.

28 lines 958 B
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } import React from 'react'; import { View } from 'react-native'; import { isFunction } from '@sendbird/uikit-utils'; import useUIKitTheme from '../../theme/useUIKitTheme'; const Box = ({ style, children, ...props }) => { const boxStyle = useBoxStyle(props); return /*#__PURE__*/React.createElement(View, _extends({}, props, { style: [boxStyle, style] }), children); }; const useBoxStyle = props => { const theme = useUIKitTheme(); const { backgroundColor, ...rest } = props; return { backgroundColor: isFunction(backgroundColor) ? backgroundColor(theme) : backgroundColor, ...rest }; }; export default Box; //# sourceMappingURL=index.js.map