UNPKG

react-native-story-component

Version:
52 lines (51 loc) 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _react = _interopRequireDefault(require("react")); var _reactNative = require("react-native"); var _reactNativeSafeareaHeight = require("react-native-safearea-height"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const AnimationBar = _ref => { let { stories, currStoryIndex, progress } = _ref; return /*#__PURE__*/_react.default.createElement(_reactNative.View, { style: styles.container }, stories.map((_, index) => { return /*#__PURE__*/_react.default.createElement(_reactNative.View, { key: index, style: styles.background }, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, { style: { flex: currStoryIndex === index ? progress : stories[index].finished ? 1 : 0, ...styles.active } })); })); }; const styles = _reactNative.StyleSheet.create({ container: { flexDirection: 'row', paddingTop: 10, paddingHorizontal: 10 }, background: { height: 2, flex: 1, flexDirection: 'row', backgroundColor: 'rgba(117, 117, 117, 0.5)', marginHorizontal: 2, marginTop: (0, _reactNativeSafeareaHeight.getStatusBarHeight)(true) }, active: { height: 2, backgroundColor: '#FFF' } }); var _default = AnimationBar; exports.default = _default; //# sourceMappingURL=AnimationBar.js.map