import React from 'react'; import {StyleSheet, View, Text} from 'react-native'; import Library from 'trapilib/dist/lib'; import { TextInput } from 'react-native'; let { CoreSystem, ViewSystem, ViewNode } = Library; export default class SideBar{ constructor(props = {}){ this.props = props this.__onUpdate = null; console.log("sssd") } onToolUpdate(props){ this.__onUpdate = fn this.props = props; } forceUpdate(props){ this.__onUpdate && this.__onUpdate(props); } switchTools(toolName){ //will be a switch function } someFunction(){ } getStyle(style) { if (typeof style === 'number') { return ReactNativePropRegistry.getByID(style); } return style; } editNode(text,node){ } //TODO Change everything :P render(){ let { tool } = this.props let NodeProps = {}; if(tool){ if(tool.selectedNode){ NodeProps = tool.selectedNode.props } } let data = Object.keys(NodeProps || {}).map((key) => { return( {key} {key === 'text' ? ( this.editNode(text,node)} value={NodeProps[key]} /> ):(null)} ) }) return ( Side Bar {data} ) } } const SelectedStyle = StyleSheet.create({ container:{ padding:5, borderWidth:2, borderColor:'green' } }) const SideBarStyle = StyleSheet.create({ container:{ padding:1, flex:1, flexDirection:'row' }, title:{ fontSize:20, textAlign:'center', fontFamily:'halvetica', color:'black', borderBottomWidth:1, borderBottomColor:'black' }, body:{ paddingLeft:5, paddingRight:5 } })