added composer query string functionality for url, text. fixed issue with no user in base_controller, cleaned up video component, albums starting
This commit is contained in:
mgabdev
2020-12-17 23:46:37 -05:00
parent 47d57960a4
commit 47cd60f851
19 changed files with 269 additions and 676 deletions

View File

@@ -3,7 +3,10 @@ import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { length } from 'stringz'
import { openPopover } from '../../actions/popover'
import { MAX_POST_CHARACTER_COUNT } from '../../constants'
import {
CX,
MAX_POST_CHARACTER_COUNT,
} from '../../constants'
import Heading from '../heading'
import Button from '../button'
import BackButton from '../back_button'
@@ -23,15 +26,27 @@ class ComposeNavigationBar extends React.PureComponent {
isSubmitting,
anyMedia,
text,
isXS,
} = this.props
const disabledButton = isSubmitting || isUploading || isChangingUpload || length(text) > MAX_POST_CHARACTER_COUNT || (length(text.trim()) === 0 && !anyMedia)
const innerClasses = CX({
d: 1,
flexRow: 1,
saveAreaInsetPT: 1,
saveAreaInsetPL: 1,
saveAreaInsetPR: 1,
w100PC: 1,
maxW640PX: !isXS,
mlAuto: !isXS,
mrAuto: !isXS,
})
return (
<div className={[_s.d, _s.z4, _s.h53PX, _s.w100PC].join(' ')}>
<div className={[_s.d, _s.h53PX, _s.bgNavigation, _s.aiCenter, _s.z3, _s.top0, _s.right0, _s.left0, _s.posFixed].join(' ')} >
<div className={[_s.d, _s.flexRow, _s.saveAreaInsetPT, _s.saveAreaInsetPL, _s.saveAreaInsetPR, _s.w100PC].join(' ')}>
<div className={innerClasses}>
<BackButton
toHome
@@ -81,6 +96,7 @@ ComposeNavigationBar.propTypes = {
isSubmitting: PropTypes.bool,
anyMedia: PropTypes.bool,
text: PropTypes.string,
isXS: PropTypes.bool,
}
export default connect(mapStateToProps, mapDispatchToProps)(ComposeNavigationBar)

View File

@@ -1,11 +1,26 @@
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { POPOVER_PROFILE_OPTIONS } from '../../constants'
import { openPopover } from '../../actions/popover'
import BackButton from '../back_button'
import Button from '../button'
import Heading from '../heading'
class ProfileNavigationBar extends React.PureComponent {
handleOpenMore = () => {
this.props.openProfileOptionsPopover({
account: this.props.account,
targetRef: this.openMoreNode,
position: 'bottom',
})
}
setOpenMoreNodeRef = (n) => {
this.openMoreNode = n
}
render() {
const { titleHTML } = this.props
@@ -51,9 +66,15 @@ class ProfileNavigationBar extends React.PureComponent {
}
const mapDispatchToProps = (dispatch) => ({
openProfileOptionsPopover(props) {
dispatch(openPopover(POPOVER_PROFILE_OPTIONS, props))
},
})
ProfileNavigationBar.propTypes = {
titleHTML: PropTypes.string,
showBackBtn: PropTypes.bool,
}
export default ProfileNavigationBar
export default connect(null, mapDispatchToProps)(ProfileNavigationBar)