Commit b59904cf authored by mgabdev's avatar mgabdev

Updated schedule post within compose modal

Placed dropdown on top
parent 232d1293
...@@ -109,9 +109,9 @@ class ComposeForm extends ImmutablePureComponent { ...@@ -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 { ...@@ -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>
......
...@@ -37,6 +37,7 @@ class SchedulePostDropdown extends React.PureComponent { ...@@ -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 { ...@@ -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 { ...@@ -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,
......
...@@ -5315,13 +5315,14 @@ noscript { ...@@ -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;
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment