Updated schedule post within compose modal

Placed dropdown on top
This commit is contained in:
mgabdev
2019-09-19 16:07:35 -04:00
parent 232d12934a
commit b59904cf55
3 changed files with 12 additions and 7 deletions

View File

@@ -109,9 +109,9 @@ class ComposeForm extends ImmutablePureComponent {
}
handleClickOutside = () => {
const { shouldCondense, scheduledAt, text } = this.props;
const { shouldCondense, scheduledAt, text, isModalOpen } = this.props;
const condensed = shouldCondense && !text;
if (condensed && scheduledAt) { //Reset scheduled date if condensing
if (condensed && scheduledAt && !isModalOpen) { //Reset scheduled date if condensing
this.props.setScheduledAt(null);
}
@@ -300,7 +300,9 @@ class ComposeForm extends ImmutablePureComponent {
{!edit && <PollButtonContainer />}
<PrivacyDropdownContainer />
<SpoilerButtonContainer />
<SchedulePostDropdownContainer />
<SchedulePostDropdownContainer
position={isModalOpen ? 'top' : undefined}
/>
</div>
<div className='character-counter__wrapper'><CharacterCounter max={maxPostCharacterCount} text={text} /></div>
</div>

View File

@@ -37,6 +37,7 @@ class SchedulePostDropdown extends React.PureComponent {
intl: PropTypes.object.isRequired,
isPro: PropTypes.bool,
onOpenProUpgradeModal: PropTypes.func.isRequired,
position: PropTypes.string,
};
handleToggle = () => {
@@ -54,12 +55,12 @@ class SchedulePostDropdown extends React.PureComponent {
}
render () {
const { intl, date, isPro } = this.props;
const { intl, date, isPro, position } = this.props;
const open = !!date;
const datePickerDisabled = !isPro;
const withPortal = isMobile(window.innerWidth);
const popperPlacement = position || undefined;
return (
<div className='schedule-post-dropdown'>
@@ -92,6 +93,7 @@ class SchedulePostDropdown extends React.PureComponent {
showTimeSelect
customInput={<DatePickerWrapper />}
withPortal={withPortal}
popperPlacement={popperPlacement}
popperModifiers={{
offset: {
enabled: true,