Nikatlas 5 ani în urmă
părinte
comite
cbf2eb669b
1 a modificat fișierele cu 8 adăugiri și 4 ștergeri
  1. 8 4
      Systems/SideBar.js

+ 8 - 4
Systems/SideBar.js

@@ -123,9 +123,7 @@ export default class SideBar extends BaseSystem {
 		}
 
 		let StyleData = Object.keys(styles || {}).map((key,index) => 
-			
-			
-			<option key={selectedNode.id + key}  value = {styles[key]}>
+			<option key={selectedNode.id + key}  value = {key} selected={this._selectedStyle === key}>
 				{key}	
 			</option>
 
@@ -155,7 +153,13 @@ export default class SideBar extends BaseSystem {
   				<Text style={SideBarStyle.title}>Side Bar</Text>
 
   				<View key={Math.random()}>
-  					<select>{StyleData}</select>
+  					<select onChange={(event) => {
+  						this._selectedStyle = event.target.value;
+  						this.ContainerNode.content.props = {...this.ContainerNode.content.props, ...styles[event.target.value]};
+  						this.forceUpdate();
+  					}}>
+  						{StyleData}
+  					</select>
   				</View>
   				<View>
   					{this.ContainerNode && <View key={this.ContainerNode.id}>