Added hidePro prop to composeForm

• Added:
- hidePro prop to composeForm for optionally hiding buttons that require pro
This commit is contained in:
mgabdev 2020-07-14 00:29:54 -05:00
parent 270a3dee15
commit 3160d97b79

View File

@ -89,7 +89,8 @@ class ComposeForm extends ImmutablePureComponent {
hasPoll: PropTypes.bool, hasPoll: PropTypes.bool,
selectedGifSrc: PropTypes.string, selectedGifSrc: PropTypes.string,
isPro: PropTypes.bool, isPro: PropTypes.bool,
}; hidePro: PropTypes.bool,
}
static defaultProps = { static defaultProps = {
showSearch: false, showSearch: false,
@ -247,6 +248,7 @@ class ComposeForm extends ImmutablePureComponent {
isSubmitting, isSubmitting,
selectedGifSrc, selectedGifSrc,
isPro, isPro,
hidePro,
} = this.props } = this.props
const disabled = isSubmitting const disabled = isSubmitting
@ -481,11 +483,17 @@ class ComposeForm extends ImmutablePureComponent {
<StatusVisibilityButton /> <StatusVisibilityButton />
<SpoilerButton /> <SpoilerButton />
<SchedulePostButton /> {
!hidePro &&
<Responsive min={BREAKPOINT_EXTRA_SMALL}> <SchedulePostButton />
<RichTextEditorButton /> }
</Responsive>
{
!hidePro &&
<Responsive min={BREAKPOINT_EXTRA_SMALL}>
<RichTextEditorButton />
</Responsive>
}
</div> </div>
<Responsive min={BREAKPOINT_EXTRA_SMALL}> <Responsive min={BREAKPOINT_EXTRA_SMALL}>