import _ from 'lodash';
import React, {Component} from 'react';
import {ScrollView} from 'react-native';
import {Colors, View, Text, Button, StackAggregator} from 'react-native-ui-lib';
const TEXTS = [
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
'Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.',
'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dummy text of the printing and typesetting industry.'
];
export default class StackAggregatorScreen extends Component {
state = {
contents: TEXTS,
collapsed: true
};
onItemPress = (index: number) => {
console.warn('item pressed: ', index);
};
onPress = (index: number) => {
console.warn('item\'s button pressed: ', index);
};
refreshItems = () => {
const newItems = _.clone(this.state.contents);
newItems.push('New Item');
this.setState({contents: newItems});
};
toggleCollapsed = () => {
this.setState({collapsed: !this.state.collapsed});
};
renderItem = (_: string, index: number) => {
return (
);
};
render() {
const {collapsed} = this.state;
return (
Thu, 10 Dec, 11:29
{_.map(this.state.contents, (item, index) => {
return this.renderItem(item, index);
})}
Thu, 11 Dec, 13:03
{_.map(this.state.contents, (item, index) => {
return this.renderItem(item, index);
})}
);
}
}