react95-native
Version:
Refreshed Windows 95 style UI components for your React Native app
66 lines (63 loc) • 1.99 kB
JavaScript
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import React from 'react';
import { View, StyleSheet, ScrollView } from 'react-native';
import { withTheme } from '../../core/theming';
import { Divider, Panel } from '../..'; // TODO: should we pass theme to wrapped components? (Divider, Panel etc);
// TODO: add noBottomBorder and noTopBorder prop
const ScrollPanel = ({
children,
noBackground,
style = {},
theme,
...rest
}) => {
return /*#__PURE__*/React.createElement(ScrollView, _extends({
horizontal: true,
showsHorizontalScrollIndicator: false,
style: [styles.wrapper, {
backgroundColor: noBackground ? 'transparent' : theme.materialDark
}, style]
}, rest), /*#__PURE__*/React.createElement(Panel, {
theme: theme,
variant: "raised",
style: [styles.borderWrapper]
}, /*#__PURE__*/React.createElement(View, {
style: [styles.inner, {
backgroundColor: theme.material
}]
}, /*#__PURE__*/React.createElement(Divider, {
theme: theme,
orientation: "vertical",
variant: "raised"
}), /*#__PURE__*/React.createElement(Divider, {
theme: theme,
orientation: "vertical",
variant: "raised"
}), /*#__PURE__*/React.createElement(View, {
style: [styles.content]
}, children))));
};
const styles = StyleSheet.create({
wrapper: {
flexGrow: 0
},
inner: {
padding: 16,
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
},
borderWrapper: {
padding: 4,
position: 'relative',
minWidth: '100%'
},
content: {
marginLeft: 8,
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
}
});
export default withTheme(ScrollPanel);
//# sourceMappingURL=ScrollPanel.js.map