You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
ReactOrganizer/tabs/Stundenliste.js

47 lines
1.3 KiB

import React, {Component} from 'react';
import {StyleSheet, SectionList, Text} from 'react-native';
import ReplacementLesson from "../model/ReplacementLesson";
export default class Stundenliste extends Component {
constructor(props) {
super(props);
console.log(props);
}
render() {
return (
<SectionList sections={this.props.data}
renderItem={({item}) => {
console.log(item, "item")
if(item instanceof ReplacementLesson) {
item.render()
}else {
console.log("NO REPLACEMENT LESSON ;C")
return ReplacementLesson.constructFromObject(item).render();
}
}}
renderSectionHeader={({section}) => <Text style={styles.sectionHeader}>{section.title}</Text>}>
</SectionList>
);
}
}
var styles = StyleSheet.create({
roundText: {
height: 30,
borderRadius: 15,
width: 30,
backgroundColor: 'green'
},
sectionHeader: {
paddingTop: 2,
paddingLeft: 10,
paddingRight: 10,
paddingBottom: 2,
fontSize: 14,
fontWeight: 'bold',
backgroundColor: 'rgba(247,247,247,1.0)',
}
});