123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- import React, { useState } from 'react';
- import {
- Modal,
- View,
- Text,
- Pressable,
- StyleSheet,
- TouchableWithoutFeedback
- } from 'react-native';
-
- const BootstrapModal = ({ visible, setVisible }) => {
-
- return (
- <Modal
- transparent
- animationType="fade"
- visible={visible}
- onRequestClose={() => setVisible(false)}
- >
- <TouchableWithoutFeedback onPress={() => setVisible(false)}>
- <View style={styles.backdrop} />
- </TouchableWithoutFeedback>
-
- <View style={styles.centeredView}>
- <View style={styles.modalView}>
- <Text style={styles.modalText}>Save as Preset Text?</Text>
- <View style={styles.titleInputContainer}>
- <Text style={styles.modalSubText}>Set Title</Text>
-
- </View>
- <Pressable
- style={[styles.button, styles.buttonClose]}
- onPress={() => setVisible(false)}
- >
- <Text style={styles.textStyle}>Save</Text>
- </Pressable>
- </View>
- </View>
- </Modal>
- );
- };
-
- const styles = StyleSheet.create({
- centeredView: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- zIndex: 10,
- },
- backdrop: {
- ...StyleSheet.absoluteFillObject,
- backgroundColor: 'rgba(0,0,0,0.5)',
- },
- modalView: {
- width: '80%',
- backgroundColor: 'white',
- borderRadius: 12,
- padding: 20,
- alignItems: 'center',
- shadowColor: '#000',
- shadowOpacity: 0.3,
- shadowRadius: 4,
- elevation: 5,
- },
- titleInputContainer: {
- alignItems:"flex-start"
- },
- openButton: {
- backgroundColor: '#007bff',
- borderRadius: 6,
- padding: 10,
- elevation: 2,
- },
- button: {
- marginTop: 15,
- padding: 10,
- borderRadius: 6,
- },
- buttonClose: {
- backgroundColor: '#DD9C49',
- borderRadius: 30,
- paddingVertical: 10,
- paddingHorizontal: 35
- },
- textStyle: {
- color: 'white',
- fontWeight: '600',
- textAlign: 'center',
-
- },
- modalText: {
- fontSize: 18,
- color: '#396868',
- fontWeight: 'bolder'
- },
- modalSubText: {
- fontSize: 12,
- color: '#396868',
- alignSelf:"flex-start",
- fontWeight: 'bolder'
- },
- textArea: {
- height: 220,
- borderColor: "#ccc",
- borderWidth: 1,
- padding: 10,
- borderRadius: 8,
- textAlignVertical: "top", // Makes text start from the top-left
- backgroundColor: "#fff",
- marginBottom: 20
- }
- });
-
- export default BootstrapModal;
|