Added portal version of date picker for mobile for schedule posts
This commit is contained in:
parent
045ad0f4fa
commit
68c1f28bb1
@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
|||||||
import { injectIntl, defineMessages } from 'react-intl';
|
import { injectIntl, defineMessages } from 'react-intl';
|
||||||
import DatePicker from 'react-datepicker';
|
import DatePicker from 'react-datepicker';
|
||||||
import IconButton from '../../../components/icon_button';
|
import IconButton from '../../../components/icon_button';
|
||||||
|
import { isMobile } from '../../../is_mobile';
|
||||||
|
|
||||||
import "react-datepicker/dist/react-datepicker.css";
|
import "react-datepicker/dist/react-datepicker.css";
|
||||||
|
|
||||||
@ -49,6 +50,7 @@ class SchedulePostDropdown extends React.PureComponent {
|
|||||||
const { open } = this.state;
|
const { open } = this.state;
|
||||||
|
|
||||||
const datePickerDisabled = !isPro;
|
const datePickerDisabled = !isPro;
|
||||||
|
const withPortal = isMobile(window.innerWidth);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='schedule-post-dropdown'>
|
<div className='schedule-post-dropdown'>
|
||||||
@ -79,6 +81,7 @@ class SchedulePostDropdown extends React.PureComponent {
|
|||||||
dateFormat="MMMM d, yyyy h:mm aa"
|
dateFormat="MMMM d, yyyy h:mm aa"
|
||||||
disabled={datePickerDisabled}
|
disabled={datePickerDisabled}
|
||||||
showTimeSelect
|
showTimeSelect
|
||||||
|
withPortal={withPortal}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user