FormEditor.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import React from 'react';
  2. import {View , Text, TextInput,StyleSheet , Button} from 'react-native';
  3. //Inputs Structure For Library
  4. /*
  5. const Inp = [
  6. {
  7. textContentType :"username",
  8. placeholder:"username"
  9. },
  10. {
  11. textContentType :"password",
  12. placeholder:"password"
  13. }]
  14. */
  15. export default class FormEditor extends React.Component {
  16. constructor(props){
  17. super(props)
  18. }
  19. addInput(e){
  20. console.log("Will add Input")
  21. }
  22. render(){
  23. let inputs = this.props.value.map((item) => {
  24. return (
  25. <View key= {Math.random()}>
  26. <TextInput
  27. style={styles.defaultInput}
  28. onChangeText={(text) => {
  29. props.onChange && props.onChange(text);
  30. }}
  31. placeholder={item.placeholder}
  32. />
  33. </View>
  34. )
  35. })
  36. return(
  37. <View styles={{height:100,width:100}}>
  38. <Text>Missing Functionality on Form </Text>
  39. {/*<Button
  40. onPress = {(e) => this.addInput(e)}
  41. title={"Add"}
  42. />*/}
  43. </View>
  44. )
  45. }
  46. }
  47. const styles = StyleSheet.create({
  48. container:{
  49. padding:10
  50. },
  51. defaultInput: {
  52. marginTop:6,
  53. borderWidth:1,
  54. width:200
  55. }
  56. })