1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Folder button styling

This commit is contained in:
Laurent Cozic 2017-07-15 19:56:24 +01:00
parent 69d85432ed
commit 472dee05ea

View File

@ -1,5 +1,5 @@
import { connect } from 'react-redux'
import { Button, Text } from 'react-native';
import { TouchableOpacity , Button, Text } from 'react-native';
import { Log } from 'lib/log.js';
import { Note } from 'lib/models/note.js';
import { FoldersScreenUtils } from 'lib/components/screens/folders-utils.js'
@ -33,6 +33,19 @@ const styles = StyleSheet.create({
fontWeight: '300',
paddingTop: 5,
},
folderButton: {
flex: 1,
backgroundColor: "#0482E3",
paddingLeft: 20,
paddingRight: 20,
paddingTop: 14,
paddingBottom: 14,
marginBottom: 5 ,
},
folderButtonText: {
color: "#ffffff",
fontWeight: 'bold',
},
button: {
flex: 1,
textAlign: 'left',
@ -81,25 +94,25 @@ class SideMenuContentComponent extends Component {
}
render() {
let keyIndex = 0;
let key = () => {
return 'smitem_' + (keyIndex++);
}
let items = [];
for (let i = 0; i < this.props.folders.length; i++) {
let f = this.props.folders[i];
let title = f.title ? f.title : '';
items.push(
<Button style={styles.button} title={title} onPress={() => { this.folder_press(f) }} key={key()} />
<TouchableOpacity key={f.id} onPress={() => { this.folder_press(f) }}>
<View style={styles.folderButton}>
<Text style={styles.folderButtonText}>{title}</Text>
</View>
</TouchableOpacity>
);
}
items.push(<Text key={key()}></Text>); // DIVIDER
items.push(<View style={{ height: 50, flex: -1 }} key='divider_1'></View>); // DIVIDER
items.push(<Button style={styles.button} title="Synchronize" onPress={() => { this.synchronize_press() }} key={key()} />);
items.push(<Button title="Synchronize" onPress={() => { this.synchronize_press() }} key='synchronize' />);
items.push(<Text key={key()}>{this.state.syncReportText}</Text>);
items.push(<Text key='sync_report'>{this.state.syncReportText}</Text>);
return (
<ScrollView scrollsToTop={false} style={styles.menu}>