UNPKG

@8man/react-native-media-console

Version:
80 lines (78 loc) 3.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TopControls = void 0; var _react = _interopRequireWildcard(require("react")); var _reactNative = require("react-native"); var _Volume = require("./Volume"); var _Back = require("./Back"); var _NullControl = require("./NullControl"); var _Title = require("@8man/react-native-media-console/src/components/Title"); function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } // import {styles} from './styles'; const TopControls = exports.TopControls = /*#__PURE__*/(0, _react.memo)(({ title, showControls, panHandlers, animations: { AnimatedView, controlsOpacity, topControl }, disableBack, disableVolume, volumeFillWidth, volumePosition, volumeTrackWidth, onBack, resetControlTimeout }) => { const backControl = disableBack ? /*#__PURE__*/_react.default.createElement(_NullControl.NullControl, null) : /*#__PURE__*/_react.default.createElement(_Back.Back, { showControls: showControls, onBack: onBack, resetControlTimeout: resetControlTimeout }); const volumeControl = disableVolume ? /*#__PURE__*/_react.default.createElement(_NullControl.NullControl, null) : /*#__PURE__*/_react.default.createElement(_Volume.Volume, { volumeFillWidth: volumeFillWidth, volumeTrackWidth: volumeTrackWidth, volumePosition: volumePosition, volumePanHandlers: panHandlers }); return /*#__PURE__*/_react.default.createElement(AnimatedView, { style: [_styles.top, controlsOpacity, topControl] }, /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, { style: _styles.topControlGroup }, /*#__PURE__*/_react.default.createElement(_reactNative.View, { style: _styles.sideControl }, backControl, /*#__PURE__*/_react.default.createElement(_Title.Title, title)), /*#__PURE__*/_react.default.createElement(_reactNative.View, { style: _styles.pullRight }, volumeControl))); }); const _styles = _reactNative.StyleSheet.create({ pullRight: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }, top: { flex: 1, alignItems: 'stretch', justifyContent: 'flex-start' }, topControlGroup: { alignSelf: 'stretch', alignItems: 'center', justifyContent: 'space-between', flexDirection: 'row', margin: 12, marginBottom: 18 }, sideControl: { flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center' } }); //# sourceMappingURL=TopControls.js.map