Skip to content

Commit

Permalink
Update on progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaseTeichmann committed Oct 1, 2019
1 parent 0c05b5b commit 3b68a38
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 34 deletions.
5 changes: 5 additions & 0 deletions Routinely/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import {Divider} from 'react-native-elements';
import Login from './app/components/login';
import DayPicker from './app/components/repeat/DayPicker';
import RepeatDiv from './app/components/repeat/RepeatDiv';
import SnoozeDuration from './app/components/repeat/SnoozeDuration';
import TimePicker from './app/components/TimePicker';

const App: () => React$Node = () => {
return (
Expand All @@ -26,6 +28,9 @@ const App: () => React$Node = () => {
<RepeatDiv/>
<DayPicker/>
<Divider/>
<SnoozeDuration/>
<Divider/>
<TimePicker/>
</View>
</View>
</SafeAreaView>
Expand Down
56 changes: 56 additions & 0 deletions Routinely/app/components/TimePicker.js
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>
);
}
}
48 changes: 48 additions & 0 deletions Routinely/app/components/repeat/SnoozeDuration.js
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
}
});
1 change: 1 addition & 0 deletions Routinely/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ target 'Routinely' do
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'RNDateTimePicker', :path => '../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec'

pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
Expand Down
14 changes: 13 additions & 1 deletion Routinely/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ PODS:
- React-cxxreact (= 0.61.0)
- React-jsi (= 0.61.0)
- ReactCommon/jscallinvoker (= 0.61.0)
- RNDateTimePicker (2.1.0):
- React
- RNVectorIcons (6.6.0):
- React
- Yoga (1.14.0)

DEPENDENCIES:
Expand Down Expand Up @@ -323,6 +327,8 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- "RNDateTimePicker (from `../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec`)"
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
Expand Down Expand Up @@ -391,6 +397,10 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/Libraries/Vibration"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNDateTimePicker:
:path: "../node_modules/@react-native-community/datetimepicker/RNDateTimePicker.podspec"
RNVectorIcons:
:path: "../node_modules/react-native-vector-icons"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

Expand Down Expand Up @@ -433,8 +443,10 @@ SPEC CHECKSUMS:
React-RCTText: beb19a6c50072a1a2f617490ea967237c98d1dfc
React-RCTVibration: c8e67f140a83a14a1ad9042950cca08ab29423fd
ReactCommon: 584ef683c340894c1c82be43ce760390493ae8bf
RNDateTimePicker: 68e542a59ff1b73563744145bfc45c2b88a3deea
RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4
Yoga: 3f70bbd9aa01e04eefec36e2a085b2fc0ff1dd98

PODFILE CHECKSUM: 3bc29821cb63b2f7a101ab4d501524bac9e9d46b
PODFILE CHECKSUM: 9432ffcbd0f9bb0a292cff633e25049120cde693

COCOAPODS: 1.7.5
Loading

0 comments on commit 3b68a38

Please sign in to comment.