Improved group selection button

This commit is contained in:
Arnaud Vergnet 2020-04-15 22:18:14 +02:00
parent e693636464
commit ffb0b03b41

View file

@ -2,7 +2,7 @@
import * as React from 'react'; import * as React from 'react';
import {StyleSheet, View} from "react-native"; import {StyleSheet, View} from "react-native";
import {Button, IconButton, Surface, withTheme} from "react-native-paper"; import {FAB, IconButton, Surface, withTheme} from "react-native-paper";
import AutoHideComponent from "./AutoHideComponent"; import AutoHideComponent from "./AutoHideComponent";
type Props = { type Props = {
@ -85,13 +85,24 @@ class AnimatedBottomBar extends React.Component<Props, State> {
style={{marginLeft: 5}} style={{marginLeft: 5}}
onPress={() => this.props.onPress('today', undefined)}/> onPress={() => this.props.onPress('today', undefined)}/>
</View> </View>
<Button <View style={{
icon="book-variant" position: "absolute",
onPress={() => this.props.navigation.navigate('group-select')} left: 0,
style={{maxWidth: '40%'}} right: 0,
> alignItems: "center",
{this.props.currentGroup.replace(/_/g, " ")} width: '100%',
</Button> height: '100%'
}}>
<FAB
style={{
position: 'absolute',
alignSelf: 'center',
top: -10,
}}
icon="account-clock"
onPress={() => this.props.navigation.navigate('group-select')}
/>
</View>
<View style={{flexDirection: 'row'}}> <View style={{flexDirection: 'row'}}>
<IconButton <IconButton
icon="chevron-left" icon="chevron-left"
@ -117,13 +128,12 @@ const styles = StyleSheet.create({
width: '90%', width: '90%',
}, },
surface: { surface: {
position: 'relative',
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
borderRadius: 50, borderRadius: 50,
elevation: 2, elevation: 2,
padding: 10,
paddingHorizontal: 20,
} }
}); });