Commit 8394afe2 by Tonk

update add timer, delete FAB,

parent ff9c98ea
...@@ -131,24 +131,7 @@ export default class TimerScreen extends Component { ...@@ -131,24 +131,7 @@ export default class TimerScreen extends Component {
<HeaderItem title="menu" iconName="ios-menu" onPress={() => console.log('menu')} /> <HeaderItem title="menu" iconName="ios-menu" onPress={() => console.log('menu')} />
</HeaderButtons> </HeaderButtons>
), ),
headerRight: ( headerRight: navigation.state.params ? navigation.state.params.headerRight : null,
<TouchableOpacity onPress={() => console.log('clicked')}>
<View style={{ marginRight: 17 }}>
<Icon name="ios-notifications" style={{ color: color.white }} />
<Badge
badgeStyle={{
width: 12,
height: 12,
borderWidth: 2,
borderRadius: 6,
backgroundColor: color.warnning,
borderColor: color.primary,
}}
containerStyle={{ position: 'absolute', top: -2, right: -4 }}
/>
</View>
</TouchableOpacity>
),
}); });
state = { state = {
...@@ -171,23 +154,24 @@ export default class TimerScreen extends Component { ...@@ -171,23 +154,24 @@ export default class TimerScreen extends Component {
search: '', search: '',
test: new Animated.Value(height * 1), test: new Animated.Value(height * 1),
}; };
componentDidMount() {
this.props.navigation.setParams({
headerRight: (
<TouchableOpacity
onPress={() =>
this.setState({
isVisible: true,
})
}
>
<View style={{ marginRight: 17 }}>
<Icon name="ios-add" style={{ color: color.white }} />
</View>
</TouchableOpacity>
),
});
}
renderTimerFab = () => {
return (
<Fab
containerStyle={{
bottom: '15%',
// right: '50%', // centerFAB
// marginRight: -28,
}}
style={{ backgroundColor: color.primary }}
position="bottomRight"
onPress={() => this.setState({ isVisible: true })}
>
<Icon name="add" />
</Fab>
);
};
autoClose = swipeInstance => { autoClose = swipeInstance => {
if (this.currentlyOpenSwipe && this.currentlyOpenSwipe !== swipeInstance) { if (this.currentlyOpenSwipe && this.currentlyOpenSwipe !== swipeInstance) {
this.currentlyOpenSwipe.close(); this.currentlyOpenSwipe.close();
...@@ -229,19 +213,8 @@ export default class TimerScreen extends Component { ...@@ -229,19 +213,8 @@ export default class TimerScreen extends Component {
}; };
onOpenModal = () => { onOpenModal = () => {
this.setState({ this.setState({
filterOpen: true, isVisible: true,
}); });
this.testslide();
};
testslide = () => {
Animated.timing(
// Animate over time
this.state.test, // The animated value to drive
{
toValue: height * 0.3, // Animate to opacity: 1 (opaque)
duration: 500, // Make it take a while
}
).start();
}; };
render() { render() {
return ( return (
...@@ -287,7 +260,11 @@ export default class TimerScreen extends Component { ...@@ -287,7 +260,11 @@ export default class TimerScreen extends Component {
<Icon <Icon
name="md-funnel" name="md-funnel"
style={{ color: '#c7cad1', fontSize: 14, marginLeft: 10 }} style={{ color: '#c7cad1', fontSize: 14, marginLeft: 10 }}
onPress={() => this.onOpenModal()} onPress={() =>
this.setState({
filterOpen: true,
})
}
/> />
</View> </View>
...@@ -318,10 +295,9 @@ export default class TimerScreen extends Component { ...@@ -318,10 +295,9 @@ export default class TimerScreen extends Component {
<FadeDimBG /> <FadeDimBG />
<View style={{ flex: 1, backgroundColor: 'transparent' }}> <View style={{ flex: 1, backgroundColor: 'transparent' }}>
<SlideUpModal ending={0.1} style={styles.scrollContainer}> <SlideUpModal ending={0.1} style={styles.scrollContainer}>
<ScrollView> <Text style={theme.title}>Create Timer</Text>
<Text style={theme.title}>Create Timer</Text> <ScrollView style={theme.mt2}>
<Text style={[theme.normalText, theme.textDark]}>Set Time</Text>
<Text style={[theme.normalText, theme.textDark, theme.mt2]}>Set Time</Text>
<DatePicker <DatePicker
date={this.state.timer} date={this.state.timer}
onDateChange={date => this.setState({ timer: date })} onDateChange={date => this.setState({ timer: date })}
...@@ -501,7 +477,6 @@ export default class TimerScreen extends Component { ...@@ -501,7 +477,6 @@ export default class TimerScreen extends Component {
</SlideUpModal> </SlideUpModal>
</View> </View>
</Modal> </Modal>
{this.renderTimerFab()}
{/* Filter Modal */} {/* Filter Modal */}
<Modal <Modal
...@@ -601,7 +576,6 @@ export default class TimerScreen extends Component { ...@@ -601,7 +576,6 @@ export default class TimerScreen extends Component {
</SlideUpModal> </SlideUpModal>
</View> </View>
</Modal> </Modal>
{/* {this.renderTimerFab()} */}
</> </>
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment