UNPKG

react95-native

Version:

Refreshed Windows 95 style UI components for your React Native app

38 lines (35 loc) 1.24 kB
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 { StyleSheet, View } from 'react-native'; import { withTheme } from '../../core/theming'; const pixelSize = 1.5; const segmentSize = 3 * pixelSize; const CheckmarkIcon = ({ disabled = false, style = {}, theme, ...rest }) => { const segmentOffsets = [2, 3, 4, 3, 2, 1, 0]; return /*#__PURE__*/React.createElement(View, _extends({ style: [styles.wrapper, style] }, rest), segmentOffsets.map((offset, i) => /*#__PURE__*/React.createElement(View, { key: i, style: [styles.segment, { marginTop: offset * pixelSize, backgroundColor: disabled ? theme.checkmarkDisabled : theme.checkmark }] }))); }; const styles = StyleSheet.create({ wrapper: { position: 'relative', flexDirection: 'row' }, segment: { width: pixelSize, height: segmentSize } }); export default withTheme(CheckmarkIcon); //# sourceMappingURL=CheckmarkIcon.js.map