Guest User

Untitled

a guest
Dec 23rd, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.28 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { StyleSheet, Text, View, Modal, ScrollView, TouchableOpacity,
  3.     Dimensions, PanResponder, Animated, Slider, Platform, TextInput, KeyboardAvoidingView,
  4.     Keyboard, UIManager } from 'react-native';
  5.  
  6. import Modalize from 'react-native-modalize';
  7.  
  8. export default class App extends Component {
  9.  
  10.     modalRef = React.createRef();
  11.  
  12.     onOpen = () => {
  13.         const modal = this.modalRef.current;   
  14.         if (modal) {
  15.           modal.open();
  16.         }
  17.     }  
  18.  
  19.     render() {
  20.  
  21.         return (
  22.             <View style={styles.container}>
  23.                 <TouchableOpacity style={{marginTop:15, backgroundColor: "lightblue", padding: 15}} onPress={() => {this.onOpen()}}>
  24.                     <Text>Toggle Modalize</Text>
  25.                 </TouchableOpacity>
  26.  
  27.                 <Modalize ref={this.modalRef}
  28.                     HeaderComponent={
  29.                         <View style={{ padding: 15, borderBottomColor: "lightgrey", borderBottomWidth: 1}}>
  30.                             <Text style={{fontSize: 20, fontWeight: "bold"}}>
  31.                                 Header
  32.                             </Text>
  33.                         </View>
  34.                     }
  35.                 >
  36.                     <Text style={{fontSize:25, fontWeight:"bold"}}>
  37.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  38.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  39.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  40.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  41.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  42.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  43.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  44.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  45.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  46.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  47.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  48.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  49.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  50.                         content i uhg iuyg iuy g iuyg uik ghiu oyhg iuo ghoi gh ioy ug iou
  51.                     </Text>
  52.                 </Modalize>
  53.             </View>
  54.  
  55.         );
  56.     }
  57. }
  58.  
  59. const styles = StyleSheet.create({
  60.   container: {
  61.     flex: 1,
  62.     backgroundColor: '#fff',
  63.     alignItems: 'center',
  64.     justifyContent: 'center',
  65.   },
  66. });
Advertisement
Add Comment
Please, Sign In to add comment