From e004fd362583a020b07f87536aac077269eaad27 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 27 Oct 2020 18:34:08 -0400 Subject: date picker done (#80) --- src/components/common/TaggDatePicker.tsx | 30 ++++++++++++++++++++++++++++++ src/components/common/index.ts | 1 + 2 files changed, 31 insertions(+) create mode 100644 src/components/common/TaggDatePicker.tsx (limited to 'src/components/common') diff --git a/src/components/common/TaggDatePicker.tsx b/src/components/common/TaggDatePicker.tsx new file mode 100644 index 00000000..d8010251 --- /dev/null +++ b/src/components/common/TaggDatePicker.tsx @@ -0,0 +1,30 @@ +import React, {useState} from 'react'; +import DatePicker from 'react-native-date-picker'; + +interface TaggDatePickerProps { + handleDateUpdate: (_: Date) => void; + maxDate: Date; + textColor: string; +} + +const TaggDatePicker: React.FC = ({ + handleDateUpdate, + maxDate, + textColor, +}) => { + const [date, setDate] = useState(new Date()); + return ( + { + setDate(newDate); + handleDateUpdate(newDate); + }} + /> + ); +}; + +export default TaggDatePicker; diff --git a/src/components/common/index.ts b/src/components/common/index.ts index 950b3f61..87ebe810 100644 --- a/src/components/common/index.ts +++ b/src/components/common/index.ts @@ -11,4 +11,5 @@ export {default as LoadingIndicator} from './LoadingIndicator'; export {default as DateLabel} from './DateLabel'; export {default as SocialLinkModal} from './SocialLinkModal'; export {default as ComingSoon} from './ComingSoon'; +export {default as TaggDatePicker} from './TaggDatePicker'; export * from './post'; -- cgit v1.2.3-70-g09d2