Added functionality to pages, layout for use with sidebar promotions
• Added: - functionality to pages, layout for use with sidebar promotions • Updated: - pages, layouts to use StatusPromotionPanel
This commit is contained in:
@@ -16,6 +16,7 @@ export default class AboutPage extends PureComponent {
|
||||
noComposeButton
|
||||
showBackBtn
|
||||
title={title}
|
||||
page='about'
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
{children}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
import DefaultLayout from '../layouts/default_layout'
|
||||
import LinkFooter from '../components/link_footer'
|
||||
@@ -8,25 +7,29 @@ import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
|
||||
export default class BasicPage extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
page: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { children, title } = this.props
|
||||
const {
|
||||
children,
|
||||
page,
|
||||
title,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<DefaultLayout
|
||||
noComposeButton
|
||||
showBackBtn
|
||||
title={title}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<TrendsPanel />
|
||||
<WhoToFollowPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
page={page}
|
||||
layout={[
|
||||
<TrendsPanel key='basic-page-trends-panel' />,
|
||||
<WhoToFollowPanel key='basic-page-wtf-panel' />,
|
||||
<LinkFooter key='basic-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
{children}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import { openModal } from '../actions/modal'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
@@ -38,21 +37,20 @@ class CommunityPage extends PureComponent {
|
||||
return (
|
||||
<DefaultLayout
|
||||
title={title}
|
||||
page='community'
|
||||
actions={[
|
||||
{
|
||||
icon: 'ellipsis',
|
||||
onClick: onOpenCommunityPageSettingsModal,
|
||||
},
|
||||
]}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<ProgressPanel />
|
||||
<TrendsPanel />
|
||||
<WhoToFollowPanel />
|
||||
<GroupSidebarPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
layout={[
|
||||
<ProgressPanel key='community-page-progress-panel' />,
|
||||
<TrendsPanel key='community-page-progress-panel' />,
|
||||
<WhoToFollowPanel key='community-page-wtf-panel' />,
|
||||
<GroupSidebarPanel key='community-page-groups-panel' />,
|
||||
<LinkFooter key='community-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
{children}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
import DefaultLayout from '../layouts/default_layout'
|
||||
import ProgressPanel from '../components/panel/progress_panel'
|
||||
@@ -18,17 +17,16 @@ export default class ExplorePage extends PureComponent {
|
||||
|
||||
return (
|
||||
<DefaultLayout
|
||||
page='explore'
|
||||
title={title}
|
||||
noComposeButton
|
||||
showBackBtn
|
||||
layout={(
|
||||
<Fragment>
|
||||
<ProgressPanel />
|
||||
<VerifiedAccountsPanel />
|
||||
<ShopPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
layout={[
|
||||
<ProgressPanel key='explore-page-progress-panel' />,
|
||||
<VerifiedAccountsPanel key='explore-page-verified-panel' />,
|
||||
<ShopPanel key='explore-page-shop-panel' />,
|
||||
<LinkFooter key='explore-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
{children}
|
||||
|
||||
@@ -56,6 +56,7 @@ class GroupPage extends ImmutablePureComponent {
|
||||
showBackBtn
|
||||
title={groupTitle}
|
||||
group={group}
|
||||
groupId={groupId}
|
||||
relationships={relationships}
|
||||
>
|
||||
<PageTitle path={[groupTitle, intl.formatMessage(messages.group)]} />
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import { me } from '../initial_state'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import { openModal } from '../actions/modal'
|
||||
@@ -93,13 +92,12 @@ class GroupsPage extends PureComponent {
|
||||
title={title}
|
||||
actions={actions}
|
||||
tabs={tabs}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<WhoToFollowPanel />
|
||||
<GroupsPanel slim />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
page='groups'
|
||||
layout={[
|
||||
<WhoToFollowPanel key='groups-page-wtf-panel' />,
|
||||
<GroupsPanel slim key='groups-page-groups-panel' />,
|
||||
<LinkFooter key='groups-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
{ children }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Fragment } from 'react'
|
||||
import { openModal } from '../actions/modal'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import isObject from 'lodash.isobject'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
import LinkFooter from '../components/link_footer'
|
||||
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
|
||||
@@ -30,6 +30,7 @@ class HashtagPage extends PureComponent {
|
||||
intl: PropTypes.object.isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
onOpenHashtagPageSettingsModal: PropTypes.func.isRequired,
|
||||
params: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -37,25 +38,27 @@ class HashtagPage extends PureComponent {
|
||||
intl,
|
||||
children,
|
||||
onOpenHashtagPageSettingsModal,
|
||||
params,
|
||||
} = this.props
|
||||
|
||||
const hashtag = isObject(params) ? params.id : ''
|
||||
|
||||
return (
|
||||
<DefaultLayout
|
||||
title={intl.formatMessage(messages.hashtagTimeline)}
|
||||
page={`hashtag.${hashtag}`}
|
||||
actions={[
|
||||
{
|
||||
icon: 'ellipsis',
|
||||
onClick: onOpenHashtagPageSettingsModal,
|
||||
},
|
||||
]}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<ProgressPanel />
|
||||
<TrendsPanel />
|
||||
<WhoToFollowPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
layout={[
|
||||
<ProgressPanel key='hashtag-page-progress-panel' />,
|
||||
<TrendsPanel key='hashtag-page-trends-panel' />,
|
||||
<WhoToFollowPanel key='hashtag-page-wtf-panel' />,
|
||||
<LinkFooter key='hashtag-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
<PageTitle path={intl.formatMessage(messages.hashtag)} />
|
||||
{children}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import throttle from 'lodash.throttle'
|
||||
import { openModal } from '../actions/modal'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
@@ -91,6 +90,7 @@ class HomePage extends PureComponent {
|
||||
|
||||
return (
|
||||
<DefaultLayout
|
||||
page='home'
|
||||
title={intl.formatMessage(messages.home)}
|
||||
actions={[
|
||||
{
|
||||
@@ -98,19 +98,17 @@ class HomePage extends PureComponent {
|
||||
onClick: onOpenHomePageSettingsModal,
|
||||
},
|
||||
]}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<UserPanel />
|
||||
<ProgressPanel />
|
||||
<ProPanel isPro={isPro} />
|
||||
<TrendsPanel />
|
||||
<ShopPanel isLazy shouldLoad={lazyLoaded} />
|
||||
<ListsPanel isLazy shouldLoad={lazyLoaded} />
|
||||
<WhoToFollowPanel isLazy shouldLoad={lazyLoaded} />
|
||||
<GroupsPanel isLazy shouldLoad={lazyLoaded} />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
layout={[
|
||||
<UserPanel key='home-page-user-panel' />,
|
||||
<ProgressPanel key='home-page-progress-panel' />,
|
||||
<ProPanel isPro={isPro} key='home-page-pro-panel' />,
|
||||
<TrendsPanel key='home-page-trends-panel' />,
|
||||
<ShopPanel isLazy shouldLoad={lazyLoaded} key='home-page-shop-panel' />,
|
||||
<ListsPanel isLazy shouldLoad={lazyLoaded} key='home-page-lists-panel' />,
|
||||
<WhoToFollowPanel isLazy shouldLoad={lazyLoaded} key='home-page-wtf-panel' />,
|
||||
<GroupsPanel isLazy shouldLoad={lazyLoaded} key='home-page-groups-panel' />,
|
||||
<LinkFooter key='home-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
|
||||
<PageTitle
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
@@ -66,6 +65,7 @@ class ListPage extends ImmutablePureComponent {
|
||||
<DefaultLayout
|
||||
showBackBtn
|
||||
title={intl.formatMessage(messages.list)}
|
||||
page='list'
|
||||
actions={[
|
||||
{
|
||||
icon: 'cog',
|
||||
@@ -76,14 +76,12 @@ class ListPage extends ImmutablePureComponent {
|
||||
// onClick: onOpenListTimelineSettingsModal,
|
||||
// },
|
||||
]}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<ListDetailsPanel list={list} onEdit={this.handleOnOpenListEditModal} />
|
||||
<TrendsPanel />
|
||||
<WhoToFollowPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
layout={[
|
||||
<ListDetailsPanel list={list} onEdit={this.handleOnOpenListEditModal} key='list-page-list-panel' />,
|
||||
<TrendsPanel key='list-page-trends-panel' />,
|
||||
<WhoToFollowPanel key='list-page-wtf-panel' />,
|
||||
<LinkFooter key='list-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
<PageTitle path={[title, intl.formatMessage(messages.list)]} />
|
||||
{ children }
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import { openModal } from '../actions/modal'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
@@ -38,19 +37,18 @@ class ListsPage extends PureComponent {
|
||||
return (
|
||||
<DefaultLayout
|
||||
title={intl.formatMessage(messages.lists)}
|
||||
page='lists'
|
||||
actions={[
|
||||
{
|
||||
icon: 'add',
|
||||
onClick: onOpenListCreateModal,
|
||||
},
|
||||
]}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<TrendsPanel />
|
||||
<WhoToFollowPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
layout={[
|
||||
<TrendsPanel key='lists-page-trends-panel' />,
|
||||
<WhoToFollowPanel key='lists-page-wtf-panel' />,
|
||||
<LinkFooter key='lists-page-link-footer' />,
|
||||
]}
|
||||
showBackBtn
|
||||
>
|
||||
<PageTitle path={intl.formatMessage(messages.lists)} />
|
||||
|
||||
@@ -1,27 +1,31 @@
|
||||
import { Fragment } from 'react'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
import LinkFooter from '../components/link_footer'
|
||||
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
|
||||
import DefaultLayout from '../layouts/default_layout'
|
||||
|
||||
export default class ModalPage extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
title: PropTypes.string,
|
||||
page: PropTypes.string,
|
||||
children: PropTypes.node,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { children, title } = this.props
|
||||
const {
|
||||
children,
|
||||
title,
|
||||
page,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<DefaultLayout
|
||||
title={title}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<WhoToFollowPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
page={page}
|
||||
layout={[
|
||||
<WhoToFollowPanel key='modal-page-wtf-panel' />,
|
||||
<LinkFooter key='search-page-link-footer' />,
|
||||
]}
|
||||
showBackBtn
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
@@ -29,4 +33,5 @@ export default class ModalPage extends PureComponent {
|
||||
</DefaultLayout>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Fragment } from 'react'
|
||||
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import { setFilter } from '../actions/notifications'
|
||||
import { me } from '../initial_state'
|
||||
@@ -86,14 +86,13 @@ class NotificationsPage extends PureComponent {
|
||||
return (
|
||||
<DefaultLayout
|
||||
title={intl.formatMessage(messages.notifications)}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<NotificationFilterPanel />
|
||||
<TrendsPanel />
|
||||
<WhoToFollowPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
page='notifications'
|
||||
layout={[
|
||||
<NotificationFilterPanel key='notification-page-filter-panel' />,
|
||||
<TrendsPanel key='notification-page-trends-panel' />,
|
||||
<WhoToFollowPanel key='notification-page-wtf-panel' />,
|
||||
<LinkFooter key='notification-page-link-footer' />,
|
||||
]}
|
||||
tabs={tabs}
|
||||
>
|
||||
<PageTitle
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import PageTitle from '../features/ui/util/page_title'
|
||||
import LinkFooter from '../components/link_footer'
|
||||
@@ -27,13 +26,12 @@ class ProPage extends PureComponent {
|
||||
return (
|
||||
<DefaultLayout
|
||||
title={title}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<ProgressPanel />
|
||||
<VerifiedAccountsPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
page='pro'
|
||||
layout={[
|
||||
<ProgressPanel key='pro-page-progress-panel' />,
|
||||
<VerifiedAccountsPanel key='pro-page-verified-panel' />,
|
||||
<LinkFooter key='pro-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
{children}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Fragment } from 'react'
|
||||
import { defineMessages, injectIntl } from 'react-intl'
|
||||
import { BREAKPOINT_EXTRA_SMALL } from '../constants'
|
||||
import Responsive from '../features/ui/util/responsive_component'
|
||||
@@ -17,17 +16,23 @@ const messages = defineMessages({
|
||||
hashtags: { id: 'hashtags', defaultMessage: 'Hashtags' },
|
||||
})
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
value: state.getIn(['search', 'value']),
|
||||
})
|
||||
|
||||
export default
|
||||
@injectIntl
|
||||
@connect(mapStateToProps)
|
||||
class SearchPage extends PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
value: PropTypes.string,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { intl, children } = this.props
|
||||
const { intl, children, value } = this.props
|
||||
|
||||
const title = intl.formatMessage(messages.search)
|
||||
const tabs = [
|
||||
@@ -49,19 +54,20 @@ class SearchPage extends PureComponent {
|
||||
},
|
||||
]
|
||||
|
||||
const qos = !!value ? value : ''
|
||||
|
||||
return (
|
||||
<Layout
|
||||
noComposeButton
|
||||
title={title}
|
||||
showBackBtn
|
||||
tabs={tabs}
|
||||
layout={(
|
||||
<Fragment>
|
||||
<SearchFilterPanel />
|
||||
<TrendsPanel />
|
||||
<LinkFooter />
|
||||
</Fragment>
|
||||
)}
|
||||
page={`search.${qos}`}
|
||||
layout={[
|
||||
<SearchFilterPanel key='search-page-search-panel' />,
|
||||
<TrendsPanel key='search-page-trends-panel' />,
|
||||
<LinkFooter key='search-page-link-footer' />,
|
||||
]}
|
||||
>
|
||||
<PageTitle path={title} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user