Fixed issue with composer destination in group, timeline
• Fixed: - mobile composer min height - issue with composer destination in group, timeline (hopefully)
This commit is contained in:
parent
27f1de6af3
commit
89225194ed
@ -289,6 +289,11 @@ export const handleComposeSubmit = (dispatch, getState, response, status) => {
|
|||||||
dispatch(insertIntoTagHistory(response.data.tags, status))
|
dispatch(insertIntoTagHistory(response.data.tags, status))
|
||||||
dispatch(submitComposeSuccess({ ...response.data }))
|
dispatch(submitComposeSuccess({ ...response.data }))
|
||||||
|
|
||||||
|
// If is group, reset composer to be in group
|
||||||
|
if (response.data.group) {
|
||||||
|
dispatch(changeComposeGroupId(response.data.group.id))
|
||||||
|
}
|
||||||
|
|
||||||
// To make the app more responsive, immediately push the status into the timeline
|
// To make the app more responsive, immediately push the status into the timeline
|
||||||
// : todo : push into comment, reload parent status, etc.
|
// : todo : push into comment, reload parent status, etc.
|
||||||
const insertIfOnline = (timelineId) => {
|
const insertIfOnline = (timelineId) => {
|
||||||
|
@ -151,8 +151,6 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
if (!this.autosuggestTextarea) return
|
|
||||||
|
|
||||||
// This statement does several things:
|
// This statement does several things:
|
||||||
// - If we're beginning a reply, and,
|
// - If we're beginning a reply, and,
|
||||||
// - Replying to zero or one users, places the cursor at the end of the textbox.
|
// - Replying to zero or one users, places the cursor at the end of the textbox.
|
||||||
@ -281,9 +279,16 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
borderColorSecondary: 1,
|
borderColorSecondary: 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const innerClasses = CX({
|
||||||
|
d: 1,
|
||||||
|
calcMaxH410PX: 1,
|
||||||
|
minH98PX: formLocation === 'timeline',
|
||||||
|
minH200PX: ['standalone', 'modal'].indexOf(formLocation) > -1,
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={[_s.d, _s.w100PC, _s.flexGrow1, _s.bgPrimary].join(' ')}>
|
<div className={[_s.d, _s.w100PC, _s.flexGrow1, _s.bgPrimary].join(' ')}>
|
||||||
<div className={[_s.d, _s.calcMaxH410PX, _s.minH98PX].join(' ')}>
|
<div className={innerClasses}>
|
||||||
|
|
||||||
<ComposeDestinationHeader formLocation={formLocation} account={account} isModal={isModalOpen} />
|
<ComposeDestinationHeader formLocation={formLocation} account={account} isModal={isModalOpen} />
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
import { connect } from 'react-redux'
|
||||||
import Sticky from 'react-stickynode'
|
import Sticky from 'react-stickynode'
|
||||||
import {
|
import {
|
||||||
CX,
|
CX,
|
||||||
BREAKPOINT_EXTRA_SMALL,
|
BREAKPOINT_EXTRA_SMALL,
|
||||||
} from '../constants'
|
} from '../constants'
|
||||||
import { me } from '../initial_state'
|
import { me } from '../initial_state'
|
||||||
|
import { changeComposeGroupId } from '../actions/compose'
|
||||||
import LoggedOutSidebar from '../components/sidebar/logged_out_sidebar'
|
import LoggedOutSidebar from '../components/sidebar/logged_out_sidebar'
|
||||||
import DefaultSidebar from '../components/sidebar/default_sidebar'
|
import DefaultSidebar from '../components/sidebar/default_sidebar'
|
||||||
import SidebarPanelGroup from '../components/sidebar_panel_group'
|
import SidebarPanelGroup from '../components/sidebar_panel_group'
|
||||||
@ -24,6 +26,12 @@ import {
|
|||||||
|
|
||||||
class Layout extends React.PureComponent {
|
class Layout extends React.PureComponent {
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
if (['group', 'compose'].indexOf(this.props.page) === -1) {
|
||||||
|
this.props.dispatch(changeComposeGroupId(null))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
actions,
|
actions,
|
||||||
@ -179,4 +187,4 @@ Layout.propTypes = {
|
|||||||
title: PropTypes.string,
|
title: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Layout
|
export default connect()(Layout)
|
@ -5,7 +5,6 @@ import { defineMessages, injectIntl } from 'react-intl'
|
|||||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||||
import { fetchGroup } from '../actions/groups'
|
import { fetchGroup } from '../actions/groups'
|
||||||
import { changeComposeGroupId } from '../actions/compose'
|
|
||||||
import PageTitle from '../features/ui/util/page_title'
|
import PageTitle from '../features/ui/util/page_title'
|
||||||
import GroupLayout from '../layouts/group_layout'
|
import GroupLayout from '../layouts/group_layout'
|
||||||
import TimelineComposeBlock from '../components/timeline_compose_block'
|
import TimelineComposeBlock from '../components/timeline_compose_block'
|
||||||
@ -16,18 +15,11 @@ import Divider from '../components/divider'
|
|||||||
class GroupPage extends ImmutablePureComponent {
|
class GroupPage extends ImmutablePureComponent {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (!this.props.group) {
|
this.props.dispatch(fetchGroup(this.props.params.id))
|
||||||
this.props.dispatch(fetchGroup(this.props.params.id))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillUnmount() {
|
|
||||||
//Reset group composer
|
|
||||||
this.props.dispatch(changeComposeGroupId(null))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
if (!!this.props.group && prevProps.params.id !== this.props.params.id) {
|
if (prevProps.params.id !== this.props.params.id) {
|
||||||
this.props.dispatch(fetchGroup(this.props.params.id))
|
this.props.dispatch(fetchGroup(this.props.params.id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user