-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c05b5b
commit 3b68a38
Showing
7 changed files
with
189 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, {Component} from 'react'; | ||
import {View, Button, Platform, UIManager} from 'react-native'; | ||
import DateTimePicker from '@react-native-community/datetimepicker'; | ||
|
||
export default class TimePicker extends Component { | ||
state = { | ||
date: new Date('2020-06-12T14:42:42'), | ||
mode: 'date', | ||
show: false, | ||
} | ||
|
||
setDate = (event, date) => { | ||
date = date || this.state.date; | ||
|
||
this.setState({ | ||
show: Platform.OS === 'ios' ? true : false, | ||
date, | ||
}); | ||
} | ||
|
||
show = mode => { | ||
this.setState({ | ||
show: true, | ||
mode, | ||
}); | ||
} | ||
|
||
datepicker = () => { | ||
this.show('date'); | ||
} | ||
|
||
timepicker = () => { | ||
this.show('time'); | ||
} | ||
|
||
render() { | ||
const { show, date, mode } = this.state; | ||
|
||
return ( | ||
<View> | ||
<View> | ||
<Button onPress={this.datepicker} title="Show date picker!" /> | ||
</View> | ||
<View> | ||
<Button onPress={this.timepicker} title="Show time picker!" /> | ||
</View> | ||
{ show && <DateTimePicker value={date} | ||
mode={mode} | ||
is24Hour={true} | ||
display="default" | ||
onChange={this.setDate} /> | ||
} | ||
</View> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import React, { Component } from 'react'; | ||
import { AppRegistry, Text, View, StyleSheet, TouchableHighlight } from 'react-native'; | ||
import { Button, Divider, ButtonGroup } from 'react-native-elements'; | ||
|
||
export default class SnoozeDuration extends Component { | ||
render() { | ||
return ( | ||
<View style = {styles.container}> | ||
<Text style = {styles.snooze}>Snooze</Text> | ||
<Divider/> | ||
<Button buttonStyle = {styles.dayBox} title='2 min'></Button> | ||
<Button buttonStyle = {styles.dayBox} title='5 min'></Button> | ||
<Button buttonStyle = {styles.dayBox} title='10 min'></Button> | ||
</View> | ||
); | ||
} | ||
} | ||
AppRegistry.registerComponent('SnoozeDuration', () => SnoozeDuration); | ||
|
||
const styles = StyleSheet.create({ | ||
dayBox:{ | ||
backgroundColor: 'lightgrey', | ||
borderColor: 'white', | ||
borderWidth: 1, | ||
borderRadius: 20, | ||
fontSize: 18, | ||
fontWeight: 'bold', | ||
fontFamily: 'Roboto', | ||
overflow: 'hidden', | ||
padding: 8, | ||
textAlign:'center', | ||
width: 80, | ||
height: 40, | ||
flexDirection: 'row', | ||
|
||
}, | ||
snooze:{ | ||
fontSize: 20, | ||
color: 'darkgrey', | ||
fontWeight: '600', | ||
padding: 5, | ||
}, | ||
container: { | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
padding: 10 | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.