Added pro feed
• Added: - pro feed
This commit is contained in:
60
app/javascript/gabsocial/features/pro_timeline.js
Normal file
60
app/javascript/gabsocial/features/pro_timeline.js
Normal file
@@ -0,0 +1,60 @@
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import { expandProTimeline } from '../actions/timelines'
|
||||
import { connectProStream } from '../actions/streaming'
|
||||
import StatusList from '../components/status_list'
|
||||
|
||||
const messages = defineMessages({
|
||||
empty: { id: 'empty_column.pro', defaultMessage: 'The pro timeline is empty.' },
|
||||
})
|
||||
|
||||
export default
|
||||
@injectIntl
|
||||
@connect(null)
|
||||
class ProTimeline extends PureComponent {
|
||||
|
||||
static contextTypes = {
|
||||
router: PropTypes.object,
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
const { dispatch } = this.props
|
||||
|
||||
dispatch(expandProTimeline())
|
||||
|
||||
this.disconnect = dispatch(connectProStream())
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.disconnect) {
|
||||
this.disconnect()
|
||||
this.disconnect = null
|
||||
}
|
||||
}
|
||||
|
||||
handleLoadMore = (maxId) => {
|
||||
const { dispatch } = this.props
|
||||
|
||||
dispatch(expandProTimeline({ maxId }))
|
||||
}
|
||||
|
||||
render () {
|
||||
const { intl } = this.props
|
||||
|
||||
const emptyMessage = intl.formatMessage(messages.empty)
|
||||
|
||||
return (
|
||||
<StatusList
|
||||
scrollKey='pro_timeline'
|
||||
timelineId='pro'
|
||||
onLoadMore={this.handleLoadMore}
|
||||
emptyMessage={emptyMessage}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,6 +36,7 @@ import ListsPage from '../../pages/lists_page'
|
||||
import BasicPage from '../../pages/basic_page'
|
||||
import ModalPage from '../../pages/modal_page'
|
||||
import SettingsPage from '../../pages/settings_page'
|
||||
import ProPage from '../../pages/pro_page'
|
||||
|
||||
import {
|
||||
AccountGallery,
|
||||
@@ -64,6 +65,7 @@ import {
|
||||
ListTimeline,
|
||||
Mutes,
|
||||
Notifications,
|
||||
ProTimeline,
|
||||
Search,
|
||||
// Shortcuts,
|
||||
StatusFeature,
|
||||
@@ -151,6 +153,7 @@ class SwitchingArea extends PureComponent {
|
||||
<WrappedRoute path='/compose' exact page={BasicPage} component={Compose} content={children} componentParams={{ title: 'Compose' }} />
|
||||
|
||||
<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' exact page={GroupsPage} component={GroupsCollection} content={children} componentParams={{ activeTab: 'featured' }} />
|
||||
<WrappedRoute path='/groups/new' exact page={GroupsPage} component={GroupsCollection} content={children} componentParams={{ activeTab: 'new' }} />
|
||||
|
||||
@@ -55,6 +55,7 @@ export function Mutes() { return import(/* webpackChunkName: "features/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') }
|
||||
export function Notifications() { return import(/* webpackChunkName: "features/notifications" */'../../notifications') }
|
||||
export function ProTimeline() { return import(/* webpackChunkName: "features/pro_timeline" */'../../pro_timeline') }
|
||||
export function ProfileOptionsPopover() { return import(/* webpackChunkName: "components/profile_options_popover" */'../../../components/popover/profile_options_popover') }
|
||||
export function ProUpgradeModal() { return import(/* webpackChunkName: "components/pro_upgrade_modal" */'../../../components/modal/pro_upgrade_modal') }
|
||||
export function ReportModal() { return import(/* webpackChunkName: "modals/report_modal" */'../../../components/modal/report_modal') }
|
||||
|
||||
Reference in New Issue
Block a user