Commiting
This commit is contained in:
@@ -11,6 +11,7 @@ import Account from '../components/account'
|
||||
import Block from '../components/block'
|
||||
import BlockHeading from '../components/block_heading'
|
||||
import ScrollableList from '../components/scrollable_list'
|
||||
import AccountPlaceholder from '../components/placeholder/account_placeholder'
|
||||
|
||||
class Blocks extends ImmutablePureComponent {
|
||||
|
||||
@@ -40,16 +41,19 @@ class Blocks extends ImmutablePureComponent {
|
||||
onLoadMore={this.handleLoadMore}
|
||||
hasMore={hasMore}
|
||||
isLoading={isLoading}
|
||||
showLoading={isLoading}
|
||||
emptyMessage={emptyMessage}
|
||||
placeholderComponent={AccountPlaceholder}
|
||||
placeholderCount={3}
|
||||
>
|
||||
{
|
||||
accountIds && accountIds.map((id) =>
|
||||
accountIds && accountIds.map((id) => (
|
||||
<Account
|
||||
key={`blocked-accounts-${id}`}
|
||||
id={id}
|
||||
compact
|
||||
/>
|
||||
)
|
||||
))
|
||||
}
|
||||
</ScrollableList>
|
||||
</Block>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { connect } from 'react-redux'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||
import { injectIntl, defineMessages } from 'react-intl'
|
||||
import { fetchGroups } from '../actions/groups'
|
||||
import { fetchGroupsByTab } from '../actions/groups'
|
||||
import { openPopover } from '../actions/popover'
|
||||
import { POPOVER_GROUP_LIST_SORT_OPTIONS } from '../constants'
|
||||
import Block from '../components/block'
|
||||
@@ -16,12 +16,12 @@ import GroupListItem from '../components/group_list_item'
|
||||
class GroupsCollection extends ImmutablePureComponent {
|
||||
|
||||
componentWillMount() {
|
||||
this.props.onFetchGroups(this.props.activeTab)
|
||||
this.props.onFetchGroupsByTab(this.props.activeTab)
|
||||
}
|
||||
|
||||
componentDidUpdate(oldProps) {
|
||||
if (this.props.activeTab && this.props.activeTab !== oldProps.activeTab) {
|
||||
this.props.onFetchGroups(this.props.activeTab)
|
||||
this.props.onFetchGroupsByTab(this.props.activeTab)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ const mapStateToProps = (state, { activeTab }) => ({
|
||||
})
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
onFetchGroups: (tab) => dispatch(fetchGroups(tab)),
|
||||
onFetchGroupsByTab: (tab) => dispatch(fetchGroupsByTab(tab)),
|
||||
onOpenSortPopover(tab, targetRef) {
|
||||
dispatch(openPopover(POPOVER_GROUP_LIST_SORT_OPTIONS, {
|
||||
targetRef,
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from '../constants'
|
||||
import { me } from '../initial_state'
|
||||
import { saveShownOnboarding } from '../actions/settings'
|
||||
import { fetchGroups } from '../actions/groups'
|
||||
import { fetchGroupsByTab } from '../actions/groups'
|
||||
import { saveUserProfileInformation } from '../actions/user'
|
||||
import { makeGetAccount } from '../selectors'
|
||||
import Button from '../components/button'
|
||||
@@ -414,7 +414,7 @@ const mapStateToProps = (state) => ({
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
onSaveShownOnboarding: () => dispatch(saveShownOnboarding()),
|
||||
onFetchFeaturedGroups: () => dispatch(fetchGroups('featured')),
|
||||
onFetchFeaturedGroups: () => dispatch(fetchGroupsByTab('featured')),
|
||||
onSaveUserProfileInformation(data) {
|
||||
dispatch(saveUserProfileInformation(data))
|
||||
},
|
||||
|
||||
@@ -4,45 +4,65 @@ import { connect } from 'react-redux'
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import { FormattedMessage } from 'react-intl'
|
||||
import { fetchLikes } from '../actions/interactions'
|
||||
import debounce from 'lodash.debounce'
|
||||
import { fetchLikes, expandLikes } from '../actions/interactions'
|
||||
import { fetchStatus } from '../actions/statuses'
|
||||
import { makeGetStatus } from '../selectors'
|
||||
import Account from '../components/account'
|
||||
import ColumnIndicator from '../components/column_indicator'
|
||||
import ScrollableList from '../components/scrollable_list'
|
||||
import AccountPlaceholder from '../components/placeholder/account_placeholder'
|
||||
|
||||
class StatusLikes extends ImmutablePureComponent {
|
||||
|
||||
componentWillMount () {
|
||||
this.props.dispatch(fetchLikes(this.props.statusId))
|
||||
this.props.dispatch(fetchStatus(this.props.statusId))
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.statusId !== this.props.statusId && nextProps.statusId) {
|
||||
this.props.dispatch(fetchLikes(nextProps.statusId))
|
||||
this.props.dispatch(fetchStatus(nextProps.statusId))
|
||||
}
|
||||
}
|
||||
|
||||
render () {
|
||||
const { accountIds, status } = this.props
|
||||
handleLoadMore = debounce(() => {
|
||||
this.props.dispatch(expandLikes(this.props.statusId))
|
||||
}, 300, { leading: true })
|
||||
|
||||
if (!accountIds) {
|
||||
return <ColumnIndicator type='loading' />
|
||||
} else if (!status) {
|
||||
render () {
|
||||
const {
|
||||
accountIds,
|
||||
isLoading,
|
||||
hasMore,
|
||||
list,
|
||||
statusId,
|
||||
} = this.props
|
||||
|
||||
if (!statusId) {
|
||||
return <ColumnIndicator type='missing' />
|
||||
}
|
||||
|
||||
const accountIdCount = !!accountIds ? accountIds.count() : 0
|
||||
|
||||
return (
|
||||
<ScrollableList
|
||||
scrollKey='likes'
|
||||
emptyMessage={<FormattedMessage id='status.likes.empty' defaultMessage='No one has liked this gab yet. When someone does, they will show up here.' />}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
hasMore={hasMore}
|
||||
isLoading={isLoading && accountIdCount === 0}
|
||||
showLoading={isLoading && accountIdCount === 0}
|
||||
placeholderComponent={AccountPlaceholder}
|
||||
placeholderCount={3}
|
||||
>
|
||||
{
|
||||
accountIds.map(id =>
|
||||
<Account key={id} id={id} />
|
||||
)
|
||||
accountIdCount > 0 && accountIds.map((id) => (
|
||||
<Account
|
||||
compact
|
||||
key={`liked-by-${id}`}
|
||||
id={id}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</ScrollableList>
|
||||
)
|
||||
@@ -52,24 +72,17 @@ class StatusLikes extends ImmutablePureComponent {
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const statusId = props.params ? props.params.statusId : props.statusId
|
||||
|
||||
const getStatus = makeGetStatus()
|
||||
const status = getStatus(state, {
|
||||
id: statusId
|
||||
})
|
||||
|
||||
return {
|
||||
status,
|
||||
statusId,
|
||||
accountIds: state.getIn(['user_lists', 'liked_by', statusId]),
|
||||
accountIds: state.getIn(['user_lists', 'liked_by', statusId, 'items']),
|
||||
hasMore: !!state.getIn(['user_lists', 'liked_by', statusId, 'next']),
|
||||
isLoading: state.getIn(['user_lists', 'liked_by', statusId, 'isLoading']),
|
||||
}
|
||||
}
|
||||
|
||||
StatusLikes.propTypes = {
|
||||
accountIds: ImmutablePropTypes.list,
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
status: ImmutablePropTypes.map,
|
||||
statusId: PropTypes.string.isRequired,
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(StatusLikes)
|
||||
export default connect(mapStateToProps)(StatusLikes)
|
||||
|
||||
@@ -4,45 +4,65 @@ import { connect } from 'react-redux'
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import { FormattedMessage } from 'react-intl'
|
||||
import { fetchReposts } from '../actions/interactions'
|
||||
import debounce from 'lodash.debounce'
|
||||
import { fetchReposts, expandReposts } from '../actions/interactions'
|
||||
import { fetchStatus } from '../actions/statuses'
|
||||
import { makeGetStatus } from '../selectors'
|
||||
import Account from '../components/account'
|
||||
import ColumnIndicator from '../components/column_indicator'
|
||||
import ScrollableList from '../components/scrollable_list'
|
||||
import AccountPlaceholder from '../components/placeholder/account_placeholder'
|
||||
|
||||
class StatusReposts extends ImmutablePureComponent {
|
||||
|
||||
componentWillMount () {
|
||||
this.props.dispatch(fetchReposts(this.props.statusId))
|
||||
this.props.dispatch(fetchStatus(this.props.statusId))
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.statusId !== this.props.statusId && nextProps.statusId) {
|
||||
this.props.dispatch(fetchReposts(nextProps.statusId))
|
||||
this.props.dispatch(fetchStatus(nextProps.statusId))
|
||||
}
|
||||
}
|
||||
|
||||
render () {
|
||||
const { accountIds, status } = this.props
|
||||
handleLoadMore = debounce(() => {
|
||||
this.props.dispatch(expandReposts(this.props.statusId))
|
||||
}, 300, { leading: true })
|
||||
|
||||
if (!accountIds) {
|
||||
return <ColumnIndicator type='loading' />
|
||||
} else if (!status) {
|
||||
render () {
|
||||
const {
|
||||
accountIds,
|
||||
isLoading,
|
||||
hasMore,
|
||||
list,
|
||||
statusId,
|
||||
} = this.props
|
||||
|
||||
if (!statusId) {
|
||||
return <ColumnIndicator type='missing' />
|
||||
}
|
||||
|
||||
const accountIdCount = !!accountIds ? accountIds.count() : 0
|
||||
|
||||
return (
|
||||
<ScrollableList
|
||||
scrollKey='reposts'
|
||||
emptyMessage={<FormattedMessage id='status.reposts.empty' defaultMessage='No one has reposted this gab yet. When someone does, they will show up here.' />}
|
||||
onLoadMore={this.handleLoadMore}
|
||||
hasMore={hasMore}
|
||||
isLoading={isLoading && accountIdCount === 0}
|
||||
showLoading={isLoading && accountIdCount === 0}
|
||||
placeholderComponent={AccountPlaceholder}
|
||||
placeholderCount={3}
|
||||
>
|
||||
{
|
||||
accountIds.map(id =>
|
||||
<Account key={id} id={id} />
|
||||
)
|
||||
accountIdCount > 0 && accountIds.map((id) => (
|
||||
<Account
|
||||
compact
|
||||
key={`reposted-by-${id}`}
|
||||
id={id}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</ScrollableList>
|
||||
)
|
||||
@@ -52,25 +72,17 @@ class StatusReposts extends ImmutablePureComponent {
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const statusId = props.params ? props.params.statusId : props.statusId
|
||||
|
||||
const getStatus = makeGetStatus()
|
||||
const status = getStatus(state, {
|
||||
id: statusId,
|
||||
// username: props.params.username,
|
||||
})
|
||||
|
||||
return {
|
||||
status,
|
||||
statusId,
|
||||
accountIds: state.getIn(['user_lists', 'reblogged_by', statusId]),
|
||||
accountIds: state.getIn(['user_lists', 'reblogged_by', statusId, 'items']),
|
||||
hasMore: !!state.getIn(['user_lists', 'reblogged_by', statusId, 'next']),
|
||||
isLoading: state.getIn(['user_lists', 'reblogged_by', statusId, 'isLoading']),
|
||||
}
|
||||
}
|
||||
|
||||
StatusReposts.propTypes = {
|
||||
accountIds: ImmutablePropTypes.list,
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
status: ImmutablePropTypes.map,
|
||||
statusId: PropTypes.string.isRequired,
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(StatusReposts)
|
||||
export default connect(mapStateToProps)(StatusReposts)
|
||||
|
||||
@@ -55,7 +55,6 @@ import {
|
||||
AccountTimeline,
|
||||
Assets,
|
||||
BlockedAccounts,
|
||||
BlockedDomains,
|
||||
BookmarkedStatuses,
|
||||
CommunityTimeline,
|
||||
Compose,
|
||||
|
||||
@@ -77,6 +77,7 @@ export function ListTimelineSettingsModal() { return import(/* webpackChunkName:
|
||||
export function MediaGallery() { return import(/* webpackChunkName: "components/media_gallery" */'../../../components/media_gallery') }
|
||||
export function MediaGalleryPanel() { return import(/* webpackChunkName: "components/media_gallery_panel" */'../../../components/panel/media_gallery_panel') }
|
||||
export function MediaModal() { return import(/* webpackChunkName: "components/media_modal" */'../../../components/modal/media_modal') }
|
||||
export function Messages() { return import(/* webpackChunkName: "features/messages" */'../../messages') }
|
||||
export function Mutes() { return import(/* webpackChunkName: "features/mutes" */'../../mutes') }
|
||||
export function MuteModal() { return import(/* webpackChunkName: "modals/mute_modal" */'../../../components/modal/mute_modal') }
|
||||
export function NavSettingsPopover() { return import(/* webpackChunkName: "modals/nav_settings_popover" */'../../../components/popover/nav_settings_popover') }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { connect } from 'react-redux'
|
||||
import noop from 'lodash.noop'
|
||||
import {
|
||||
fetchBundleRequest,
|
||||
fetchBundleSuccess,
|
||||
@@ -8,7 +9,6 @@ import {
|
||||
} from '../../../actions/bundles'
|
||||
|
||||
const emptyComponent = () => null
|
||||
const noop = () => { }
|
||||
|
||||
class Bundle extends React.PureComponent {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user