Progress and testing status w comments
This commit is contained in:
@@ -49,6 +49,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
static propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
edit: PropTypes.bool,
|
||||
isMatch: PropTypes.bool,
|
||||
text: PropTypes.string.isRequired,
|
||||
suggestions: ImmutablePropTypes.list,
|
||||
account: ImmutablePropTypes.map.isRequired,
|
||||
@@ -234,6 +235,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
replyToId,
|
||||
hasPoll,
|
||||
isUploading,
|
||||
isMatch,
|
||||
} = this.props
|
||||
const disabled = this.props.isSubmitting;
|
||||
const text = [this.props.spoilerText, countableText(this.props.text)].join('');
|
||||
@@ -248,7 +250,10 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
|
||||
const childContainerClasses = cx({
|
||||
default: 1,
|
||||
flexNormal: 1,
|
||||
flexWrap: 1,
|
||||
overflowHidden: 1,
|
||||
flex1: 1,
|
||||
alignItemsEnd: shouldCondense,
|
||||
flexRow: shouldCondense,
|
||||
radiusSmall: shouldCondense,
|
||||
backgroundSubtle: shouldCondense,
|
||||
@@ -262,6 +267,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
alignItemsStart: shouldCondense,
|
||||
mt10: !shouldCondense,
|
||||
px15: !shouldCondense,
|
||||
marginLeftAuto: shouldCondense,
|
||||
})
|
||||
|
||||
return (
|
||||
@@ -361,7 +367,21 @@ class ComposeForm extends ImmutablePureComponent {
|
||||
<SchedulePostButton />
|
||||
}
|
||||
<GifSelectorButton small={shouldCondense} />
|
||||
<EmojiPickerButton small={shouldCondense} />
|
||||
<EmojiPickerButton small={shouldCondense} isMatch={isMatch} />
|
||||
|
||||
{
|
||||
shouldCondense /* && (hasPoll || anyMedia || text) */ &&
|
||||
<div className={[_s.default, _s.justifyContentCenter].join(' ')}>
|
||||
<Button
|
||||
narrow
|
||||
onClick={this.handleSubmit}
|
||||
disabled={disabledButton}
|
||||
className={_s.px10}
|
||||
>
|
||||
{intl.formatMessage(scheduledAt ? messages.schedulePost : messages.publish)}
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@ class EmojiPickerButton extends PureComponent {
|
||||
onClick: PropTypes.func.isRequired,
|
||||
active: PropTypes.bool,
|
||||
small: PropTypes.bool,
|
||||
isMatch: PropTypes.bool,
|
||||
}
|
||||
|
||||
handleClick = (e) => {
|
||||
@@ -42,7 +43,12 @@ class EmojiPickerButton extends PureComponent {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { active, small, intl } = this.props
|
||||
const {
|
||||
active,
|
||||
intl,
|
||||
isMatch,
|
||||
small,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<ComposeExtraButton
|
||||
@@ -50,7 +56,7 @@ class EmojiPickerButton extends PureComponent {
|
||||
onClick={this.handleClick}
|
||||
icon='happy'
|
||||
small={small}
|
||||
active={active}
|
||||
active={active && isMatch}
|
||||
buttonRef={this.setButton}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { injectIntl, defineMessages } from 'react-intl'
|
||||
import { openModal } from '../../../actions/modal'
|
||||
import { openPopover } from '../../../actions/popover'
|
||||
import { closePopover, openPopover } from '../../../actions/popover'
|
||||
import { me } from '../../../initial_state'
|
||||
import ComposeExtraButton from './compose_extra_button'
|
||||
|
||||
@@ -11,6 +11,7 @@ const messages = defineMessages({
|
||||
})
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
active: !!state.getIn(['compose', 'scheduled_at']) || state.getIn(['popover', 'popoverType']) === 'DATE_PICKER',
|
||||
isPro: state.getIn(['accounts', me, 'is_pro']),
|
||||
})
|
||||
|
||||
@@ -21,6 +22,10 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
}))
|
||||
},
|
||||
|
||||
onCloseDatePickerPopover() {
|
||||
dispatch(closePopover())
|
||||
},
|
||||
|
||||
onOpenProUpgradeModal() {
|
||||
dispatch(openModal('PRO_UPGRADE'))
|
||||
},
|
||||
@@ -32,10 +37,12 @@ export default
|
||||
class SchedulePostDropdown extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
active: PropTypes.bool.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
isPro: PropTypes.bool,
|
||||
onOpenProUpgradeModal: PropTypes.func.isRequired,
|
||||
onOpenDatePickerPopover: PropTypes.func.isRequired,
|
||||
onCloseDatePickerPopover: PropTypes.func.isRequired,
|
||||
small: PropTypes.bool,
|
||||
}
|
||||
|
||||
@@ -52,15 +59,20 @@ class SchedulePostDropdown extends PureComponent {
|
||||
}
|
||||
|
||||
render () {
|
||||
const { intl, small } = this.props
|
||||
const {
|
||||
active,
|
||||
intl,
|
||||
small,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<ComposeExtraButton
|
||||
active={active}
|
||||
buttonRef={this.setButton}
|
||||
icon='calendar'
|
||||
title={intl.formatMessage(messages.schedule_status)}
|
||||
onClick={this.handleToggle}
|
||||
small={small}
|
||||
buttonRef={this.setButton}
|
||||
title={intl.formatMessage(messages.schedule_status)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user