From 55dd497fd01c2e778c70b60142690a5365be299a Mon Sep 17 00:00:00 2001 From: u-e Date: Fri, 24 May 2019 21:35:30 +0300 Subject: [PATCH] init date time picker component --- .../basicHeader/view/basicHeaderView.js | 2 +- .../view/dateTimePickerStyles.js | 0 .../dateTimePicker/view/dateTimePickerView.js | 22 +++++++++++++++++++ src/providers/esteem/esteem.js | 1 + .../editor/container/editorContainer.js | 16 ++++++++------ 5 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 src/components/dateTimePicker/view/dateTimePickerStyles.js create mode 100644 src/components/dateTimePicker/view/dateTimePickerView.js diff --git a/src/components/basicHeader/view/basicHeaderView.js b/src/components/basicHeader/view/basicHeaderView.js index 95fc53c19..5d7b7968e 100644 --- a/src/components/basicHeader/view/basicHeaderView.js +++ b/src/components/basicHeader/view/basicHeaderView.js @@ -194,7 +194,7 @@ class BasicHeaderView extends Component { { + const { + type, + isChecked, + onSubmit, + } = props; + + const [date, setDate] = useState(''); + const [time, setTime] = useState(''); + + return ( + + ); +}; + +export default DateTimePickerView; diff --git a/src/providers/esteem/esteem.js b/src/providers/esteem/esteem.js index 799020b68..70141f143 100644 --- a/src/providers/esteem/esteem.js +++ b/src/providers/esteem/esteem.js @@ -2,6 +2,7 @@ import api from '../../config/api'; import searchApi from '../../config/search'; import imageApi from '../../config/imageApi'; import serverList from '../../config/serverListApi'; +import { jsonStringify } from '../../utils/jsonUtils'; export const getCurrencyRate = currency => api.get(`/currencyRate/${currency.toUpperCase()}/steem`).then(resp => resp.data); diff --git a/src/screens/editor/container/editorContainer.js b/src/screens/editor/container/editorContainer.js index 53947bba3..ac087125c 100644 --- a/src/screens/editor/container/editorContainer.js +++ b/src/screens/editor/container/editorContainer.js @@ -132,13 +132,15 @@ class EditorContainer extends Component { } else { await getDraftPost(username) .then((result) => { - this.setState({ - draftPost: { - body: result.body, - title: result.title, - tags: result.tags.split(','), - }, - }); + if (result) { + this.setState({ + draftPost: { + body: result.body, + title: result.title, + tags: result.tags.split(','), + }, + }); + } }); } };