Finished updating the reformatting of propTypes and set redux, intl functions to end of component

• Finished:
- updating the reformatting of propTypes and set redux, intl functions to end of component

• Removed:
- Gif implementation
This commit is contained in:
mgabdev
2020-08-18 19:22:15 -05:00
parent e21a6ff897
commit 99982c0391
102 changed files with 2540 additions and 3285 deletions

View File

@@ -200,7 +200,6 @@ class ComposeForm extends ImmutablePureComponent {
isMatch,
isChangingUpload,
isSubmitting,
selectedGifSrc,
isPro,
hidePro,
} = this.props
@@ -390,19 +389,6 @@ class ComposeForm extends ImmutablePureComponent {
</div>
}
{
/* : todo :
!!selectedGifSrc && !anyMedia &&
<div className={[_s.d, _s.px15].join(' ')}>
<GifForm
replyToId={replyToId}
small={shouldCondense}
selectedGifSrc={selectedGifSrc}
/>
</div>
*/
}
{
!edit && hasPoll &&
<div className={[_s.d, _s.px15, _s.mt5].join(' ')}>
@@ -518,7 +504,6 @@ ComposeForm.propTypes = {
replyToId: PropTypes.string,
reduxReplyToId: PropTypes.string,
hasPoll: PropTypes.bool,
selectedGifSrc: PropTypes.string,
isPro: PropTypes.bool,
hidePro: PropTypes.bool,
autoJoinGroup: PropTypes.bool,

View File

@@ -1,45 +0,0 @@
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { clearSelectedGif } from '../../../actions/tenor'
import Image from '../../../components/image'
class GifForm extends React.PureComponent {
render () {
const {
selectedGifSrc,
small,
} = this.props
if (!selectedGifSrc) return null
return (
<div className={_s.d}>
<div className={[_s.d, _s.flexRow, _s.flexWrap].join(' ')}>
<Image
width='auto'
src={selectedGifSrc}
className={[_s.maxW100PC, _s.radiusSmall, _s.h260PX].join(' ')}
/>
</div>
</div>
)
}
}
const mapDispatchToProps = (dispatch) => ({
onClearSelectedGif() {
dispatch(clearSelectedGif())
},
})
GifForm.propTypes = {
onClearSelectedGif: PropTypes.func.isRequired,
replyToId: PropTypes.string,
small: PropTypes.bool,
selectedGifSrc: PropTypes.string.isRequired,
}
export default connect(null, mapDispatchToProps)(GifForm)

View File

@@ -119,16 +119,6 @@ class PollForm extends ImmutablePureComponent {
class PollFormOption extends ImmutablePureComponent {
static propTypes = {
title: PropTypes.string.isRequired,
index: PropTypes.number.isRequired,
isPollMultiple: PropTypes.bool,
onChange: PropTypes.func.isRequired,
onRemove: PropTypes.func.isRequired,
onToggleMultiple: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}
handleOptionTitleChange = (value) => {
this.props.onChange(this.props.index, value)
}
@@ -195,6 +185,16 @@ class PollFormOption extends ImmutablePureComponent {
}
PollFormOption.propTypes = {
title: PropTypes.string.isRequired,
index: PropTypes.number.isRequired,
isPollMultiple: PropTypes.bool,
onChange: PropTypes.func.isRequired,
onRemove: PropTypes.func.isRequired,
onToggleMultiple: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}
const messages = defineMessages({
option_placeholder: { id: 'compose_form.poll.option_placeholder', defaultMessage: 'Choice {number}' },
add_option: { id: 'compose_form.poll.add_option', defaultMessage: 'Add a choice' },