InsertForm.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import Tool from '../Systems/Tool';
  2. import { View , Text , Button , TextInput , StyleSheet} from 'react-native';
  3. import { Icon } from 'react-native-elements'
  4. import React from 'react';
  5. import Library from 'trapilib/dist/lib';
  6. let {
  7. CoreSystem,
  8. ViewSystem,
  9. ViewNode
  10. } = Library;
  11. const styles = StyleSheet.create({
  12. container: {
  13. flex: 1,
  14. borderRadius: 4,
  15. borderWidth: 1,
  16. borderColor: '#d6d7da',
  17. alignItems: 'center',
  18. justifyContent: 'center',
  19. },
  20. text:{
  21. flex:1,
  22. backgroundColor:'red'
  23. }
  24. });
  25. export default class InsertForm extends Tool{
  26. constructor(){
  27. super()
  28. }
  29. editViewNode(CS,node){
  30. let View = null;
  31. if(!node ){
  32. return;
  33. }
  34. let Views = CS.ViewSystem.views;
  35. Object.keys(Views).map((key) => {
  36. if(Views[key].ViewTree.nodes[node.id]){
  37. View = key;
  38. }
  39. })
  40. let EditNode = new ViewNode(Math.random(),"ViewComp",{text:"Manipulationg the dom",style:styles})
  41. Views[View].setContent(EditNode,node);
  42. }
  43. render(){
  44. return(
  45. <View>
  46. <Button
  47. title={<Icon name='comment'
  48. color="#606060"
  49. />}
  50. />
  51. </View>
  52. )
  53. }
  54. }