aboutsummaryrefslogtreecommitdiff
path: root/src/components/onboarding
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/onboarding')
-rw-r--r--src/components/onboarding/BirthDatePicker.tsx9
-rw-r--r--src/components/onboarding/TaggDropDown.tsx7
2 files changed, 10 insertions, 6 deletions
diff --git a/src/components/onboarding/BirthDatePicker.tsx b/src/components/onboarding/BirthDatePicker.tsx
index f97f1a72..0fc597c3 100644
--- a/src/components/onboarding/BirthDatePicker.tsx
+++ b/src/components/onboarding/BirthDatePicker.tsx
@@ -15,6 +15,8 @@ import {TaggDatePicker} from '../common';
interface BirthDatePickerProps extends TextInputProps {
handleBDUpdate: (_: Date) => void;
width?: number | string;
+ date: Date | undefined;
+ showPresetdate: boolean;
}
const BirthDatePicker = React.forwardRef(
@@ -23,7 +25,7 @@ const BirthDatePicker = React.forwardRef(
const maxDate = moment().subtract(13, 'y').subtract(1, 'd');
return maxDate.toDate();
};
- const [date, setDate] = useState(new Date(0));
+ const [date, setDate] = useState(props.date);
const [hidden, setHidden] = useState(true);
const [updated, setUpdated] = useState(false);
const textColor = updated ? 'white' : '#ddd';
@@ -42,7 +44,9 @@ const BirthDatePicker = React.forwardRef(
style={[styles.input, {width: props.width}, {color: textColor}]}
ref={ref}
{...props}>
- {updated ? moment(date).format('YYYY-MM-DD') : 'Date of Birth'}
+ {(updated || props.showPresetdate) && date
+ ? moment(date).format('YYYY-MM-DD')
+ : 'Date of Birth'}
</Text>
</TouchableOpacity>
<Modal visible={!hidden} transparent={true} animationType="fade">
@@ -67,6 +71,7 @@ const BirthDatePicker = React.forwardRef(
handleDateUpdate={updateDate}
maxDate={getMaxDate()}
textColor={'black'}
+ date={date}
/>
</View>
</TouchableWithoutFeedback>
diff --git a/src/components/onboarding/TaggDropDown.tsx b/src/components/onboarding/TaggDropDown.tsx
index a45426ca..db531cc4 100644
--- a/src/components/onboarding/TaggDropDown.tsx
+++ b/src/components/onboarding/TaggDropDown.tsx
@@ -1,8 +1,8 @@
import React from 'react';
-import RNSelectPicker from 'react-native-picker-select';
-import {View, StyleSheet, TextInputProps} from 'react-native';
+import {StyleSheet, View} from 'react-native';
+import RNSelectPicker, {PickerSelectProps} from 'react-native-picker-select';
-interface TaggDropDownProps extends TextInputProps {
+interface TaggDropDownProps extends PickerSelectProps {
width?: number | string;
}
@@ -19,7 +19,6 @@ const TaggDropDown = React.forwardRef((props: TaggDropDownProps, ref: any) => {
const styles = StyleSheet.create({
container: {
- width: '66.67%',
alignItems: 'center',
marginVertical: 11,
},