Commit 3c252e0f authored by mgabdev's avatar mgabdev

Removed unused CommunityTimeline references, public timeline route

• Removed:
- unused CommunityTimeline references, public timeline route
parent 89a16b10
......@@ -86,9 +86,6 @@ export const dequeueTimeline = (timeline, expandFunc, optionalExpandArgs) => (di
if (timeline === 'home') {
dispatch(clearTimeline(timeline))
dispatch(expandHomeTimeline(optionalExpandArgs))
} else if (timeline === 'community') {
dispatch(clearTimeline(timeline))
dispatch(expandCommunityTimeline(optionalExpandArgs))
} else {
shouldDispatchDequeue = false
}
......@@ -238,16 +235,6 @@ export const expandProTimeline = ({ maxId } = {}, done = noop) => {
}, done)
}
/**
*
*/
export const expandCommunityTimeline = ({ maxId, onlyMedia } = {}, done = noop) => {
return expandTimeline(`community${onlyMedia ? ':media' : ''}`, '/api/v1/timelines/public', {
max_id: maxId,
only_media: !!onlyMedia,
}, done)
}
/**
*
*/
......
import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { defineMessages, injectIntl } from 'react-intl'
import { expandCommunityTimeline } from '../actions/timelines'
import StatusList from '../components/status_list'
class CommunityTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,
}
componentDidMount () {
const { dispatch, onlyMedia } = this.props
dispatch(expandCommunityTimeline({ onlyMedia }))
}
componentDidUpdate (prevProps) {
if (prevProps.onlyMedia !== this.props.onlyMedia) {
const { dispatch, onlyMedia } = this.props
dispatch(expandCommunityTimeline({ onlyMedia }))
}
}
handleLoadMore = maxId => {
const { dispatch, onlyMedia } = this.props
dispatch(expandCommunityTimeline({ maxId, onlyMedia }))
}
render () {
const { intl, onlyMedia } = this.props
const emptyMessage = intl.formatMessage(messages.empty)
return (
<StatusList
scrollKey='community_timeline'
timelineId={`community${onlyMedia ? ':media' : ''}`}
onLoadMore={this.handleLoadMore}
emptyMessage={emptyMessage}
/>
)
}
}
const messages = defineMessages({
empty: { id: 'empty_column.community', defaultMessage: 'The community timeline is empty. Write something publicly to get the ball rolling!' },
})
const mapStateToProps = (state) => ({
onlyMedia: state.getIn(['settings', 'community', 'other', 'onlyMedia'])
})
CommunityTimeline.propTypes = {
dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
onlyMedia: PropTypes.bool,
}
export default injectIntl(connect(mapStateToProps)(CommunityTimeline))
\ No newline at end of file
......@@ -71,7 +71,6 @@ import {
ChatConversationRequests,
ChatConversationBlockedAccounts,
ChatConversationMutes,
CommunityTimeline,
Compose,
Deck,
DMCA,
......@@ -227,7 +226,6 @@ class SwitchingArea extends React.PureComponent {
<WrappedRoute path='/messages/muted_conversations' exact page={MessagesPage} component={ChatConversationMutes} content={children} componentParams={{ isSettings: true }} />
<WrappedRoute path='/messages/:chatConversationId' exact page={MessagesPage} component={Messages} content={children} componentParams={{ source: 'approved' }} />
<WrappedRoute path='/timeline/all' exact page={CommunityPage} component={CommunityTimeline} content={children} componentParams={{ title: 'Community Feed' }} />
<WrappedRoute path='/timeline/pro' exact page={ProPage} component={ProTimeline} content={children} componentParams={{ title: 'Pro Feed' }} />
<WrappedRoute path='/groups' publicRoute exact page={GroupsPage} component={GroupCollectionTimeline} content={children} componentParams={{ activeTab: 'timeline', collectionType: 'member' }} />
......
......@@ -28,7 +28,6 @@ export function ChatConversationMutes() { return import(/* webpackChunkName: "fe
export function ChatMessageOptionsPopover() { return import(/* webpackChunkName: "components/chat_message_options_popover" */'../../../components/popover/chat_message_options_popover') }
export function ChatSettingsPopover() { return import(/* webpackChunkName: "components/chat_settings_popover" */'../../../components/popover/chat_settings_popover') }
export function CommentSortingOptionsPopover() { return import(/* webpackChunkName: "components/comment_sorting_options_popover" */'../../../components/popover/comment_sorting_options_popover') }
export function CommunityTimeline() { return import(/* webpackChunkName: "features/community_timeline" */'../../community_timeline') }
export function Compose() { return import(/* webpackChunkName: "features/compose" */'../../compose') }
export function ComposeForm() { return import(/* webpackChunkName: "components/compose_form" */'../../compose/components/compose_form') }
export function ComposeModal() { return import(/* webpackChunkName: "components/compose_modal" */'../../../components/modal/compose_modal') }
......
......@@ -210,7 +210,6 @@ Rails.application.routes.draw do
namespace :timelines do
resource :home, only: :show, controller: :home
resource :public, only: :show, controller: :public
resource :pro, only: :show, controller: :pro
resources :tag, only: :show
resources :list, only: :show
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment