InsertForm.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. let selectStyle;
  45. if(this.active){
  46. selectStyle = {backgroundColor:"#a6a6a6"}
  47. }else{
  48. selectStyle = {backgroundColor:"#F1F1F1"}
  49. }
  50. return(
  51. <View>
  52. <Button
  53. color="#f1f1f1"
  54. title={<Icon name='comment'
  55. color="#606060"
  56. containerStyle={selectStyle}
  57. />}
  58. />
  59. </View>
  60. )
  61. }
  62. }