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

View File

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

View File

@ -5315,13 +5315,14 @@ noscript {
text-align: left; text-align: left;
width: 145px; width: 145px;
height: 26px; height: 26px;
line-height: 20px; font-size: 11px;
color: $inverted-text-color; color: $inverted-text-color;
background: $simple-background-color; background: $simple-background-color;
@media (max-width: 580px) { @media (max-width: 580px) {
width: 138px; width: 124px;
font-size: 10px; font-size: 10px;
padding-left: 2px; padding-left: 2px;
margin-left: 2px;
} }
} }