1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import React from 'react';
- import {StyleSheet, View, Text , Button} from 'react-native';
- import { TextInput } from 'react-native';
- export default class ModuleBar {
- constructor(CS){
- this.CoreSystem = CS;
- }
- selectModule(mod, namespace) {
- this.selectedModule = mod;
- this.selectedModuleNamespace = namespace;
- }
- dragStart(ev, data) {
- ev.nativeEvent.dataTransfer.setData("MyObject", JSON.stringify(data));
- }
- render(){
- let list = this.CoreSystem.ModuleSystem.list();
- let Render = Object.keys(list).map((key, index) => {
- let items = Object.keys(list[key]).map((name,ind) => {
- return <View key={name} onClick={() => this.selectModule(list[key][name], key)}>
- <Text draggable={true} onDragStart={(ev) => this.dragStart(ev, {
- namespace: key,
- ctor: name
- })}>{name}</Text>
- </View>
- });
- return <View key={key}>
- <Text>{key}</Text>
- {items}
- </View>;
- })
- return Render;
- }
- }
|