UNPKG

@interactify-live/pindo-wizard-react-native

Version:

React Native PindoWizard component for media capture and interaction management

54 lines (53 loc) 2.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const react_native_1 = require("react-native"); const BottomControls = (0, react_1.memo)(({ medias, onFinish }) => { const handleFinish = (0, react_1.useCallback)(() => { const mediaWithInteractions = medias.map(media => ({ id: media.id, type: media.type, url: media.url, thumbnail: media.thumbnail, interactions: media.interactions, response: media.response, })); onFinish(mediaWithInteractions); }, [medias, onFinish]); // Check if any media is currently uploading const isAnyMediaUploading = medias.some(media => media.isUploading); return ((0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.bottomControls, children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: styles.finishButtonContainer, children: (0, jsx_runtime_1.jsx)(react_native_1.TouchableOpacity, { style: [ styles.finishButton, isAnyMediaUploading && styles.finishButtonDisabled, ], onPress: handleFinish, disabled: isAnyMediaUploading, children: isAnyMediaUploading ? ((0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { size: "small", color: "#ffffff" })) : ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: styles.finishButtonText, children: "\u0627\u062F\u0627\u0645\u0647" })) }) }) })); }); const styles = react_native_1.StyleSheet.create({ bottomControls: { height: 120, backgroundColor: '#000000', paddingTop: 12, }, finishButtonContainer: { flex: 1, padding: 12, justifyContent: 'center', }, finishButton: { backgroundColor: 'rgba(37, 79, 195, 1)', height: 44, borderRadius: 9, justifyContent: 'center', alignItems: 'center', marginBottom: 32, }, finishButtonText: { color: '#ffffff', fontSize: 14, fontWeight: 'bold', }, finishButtonDisabled: { backgroundColor: 'rgba(128, 128, 128, 0.5)', }, }); exports.default = BottomControls;