Commiting
This commit is contained in:
40
app/javascript/gabsocial/pages/compose_page.js
Normal file
40
app/javascript/gabsocial/pages/compose_page.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
import DefaultLayout from '../layouts/default_layout'
|
||||
|
||||
class ComposePage extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
const {
|
||||
children,
|
||||
page,
|
||||
title,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<DefaultLayout
|
||||
noComposeButton
|
||||
showBackBtn
|
||||
title={title}
|
||||
page={page}
|
||||
actions={[
|
||||
{
|
||||
title: 'Post',
|
||||
onClick: this.onOpenCommunityPageSettingsModal,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
{children}
|
||||
</DefaultLayout>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ComposePage.propTypes = {
|
||||
children: PropTypes.node.isRequired,
|
||||
}
|
||||
|
||||
export default ComposePage
|
||||
@@ -2,13 +2,17 @@ import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { connect } from 'react-redux'
|
||||
import throttle from 'lodash.throttle'
|
||||
import { openModal } from '../actions/modal'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import { MODAL_HOME_TIMELINE_SETTINGS } from '../constants'
|
||||
import { openModal } from '../actions/modal'
|
||||
import {
|
||||
MODAL_HOME_TIMELINE_SETTINGS,
|
||||
LAZY_LOAD_SCROLL_OFFSET,
|
||||
} from '../constants'
|
||||
import { me } from '../initial_state'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
import DefaultLayout from '../layouts/default_layout'
|
||||
import TimelineComposeBlock from '../components/timeline_compose_block'
|
||||
import TabBar from '../components/tab_bar'
|
||||
import WrappedBundle from '../features/ui/util/wrapped_bundle'
|
||||
import {
|
||||
UserPanel,
|
||||
@@ -47,7 +51,7 @@ class HomePage extends React.PureComponent {
|
||||
if (this.window) {
|
||||
const { scrollTop } = this.documentElement
|
||||
|
||||
if (scrollTop > 25 && !this.state.lazyLoaded) {
|
||||
if (scrollTop > LAZY_LOAD_SCROLL_OFFSET && !this.state.lazyLoaded) {
|
||||
this.setState({ lazyLoaded: true })
|
||||
this.detachScrollListener()
|
||||
}
|
||||
@@ -98,11 +102,10 @@ class HomePage extends React.PureComponent {
|
||||
path={title}
|
||||
badge={totalQueuedItemsCount}
|
||||
/>
|
||||
|
||||
|
||||
<TimelineComposeBlock autoFocus={false} />
|
||||
|
||||
{children}
|
||||
|
||||
|
||||
</DefaultLayout>
|
||||
)
|
||||
}
|
||||
|
||||
38
app/javascript/gabsocial/pages/messages_page.js
Normal file
38
app/javascript/gabsocial/pages/messages_page.js
Normal file
@@ -0,0 +1,38 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { connect } from 'react-redux'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
import MessagesLayout from '../layouts/messages_layout'
|
||||
|
||||
class MessagesPage extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
const { children, intl } = this.props
|
||||
|
||||
const title = intl.formatMessage(messages.chats)
|
||||
|
||||
return (
|
||||
<MessagesLayout
|
||||
showBackBtn
|
||||
title={title}
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
{children}
|
||||
</MessagesLayout>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const messages = defineMessages({
|
||||
chats: { id: 'chats', defaultMessage: 'Chats' },
|
||||
})
|
||||
|
||||
MessagesPage.propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
}
|
||||
|
||||
export default injectIntl(connect()(MessagesPage))
|
||||
@@ -15,7 +15,9 @@ import ProfileLayout from '../layouts/profile_layout'
|
||||
class ProfilePage extends ImmutablePureComponent {
|
||||
|
||||
componentDidMount() {
|
||||
this.props.dispatch(fetchAccountByUsername(this.props.params.username))
|
||||
if (!this.props.account) {
|
||||
this.props.dispatch(fetchAccountByUsername(this.props.params.username))
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in New Issue
Block a user