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:
		
							parent
							
								
									15c7ff1eba
								
							
						
					
					
						commit
						06d85fe8d8
					
				| @ -170,7 +170,7 @@ class SwitchingArea extends PureComponent { | |||||||
| 
 | 
 | ||||||
|         <WrappedRoute path='/explore' publicRoute page={ExplorePage} component={Explore} content={children} componentParams={{ title: 'Explore' }} /> |         <WrappedRoute path='/explore' publicRoute page={ExplorePage} component={Explore} content={children} componentParams={{ title: 'Explore' }} /> | ||||||
| 
 | 
 | ||||||
|         <WrappedRoute path='/compose' exact page={BasicPage} component={Compose} content={children} componentParams={{ title: 'Compose' }} /> |         <WrappedRoute path='/compose' exact page={BasicPage} component={Compose} content={children} componentParams={{ title: 'Compose', page: 'compose' }} /> | ||||||
| 
 | 
 | ||||||
|         <WrappedRoute path='/timeline/all' exact page={CommunityPage} component={CommunityTimeline} content={children} componentParams={{ title: 'Community Feed' }} /> |         <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='/timeline/pro' exact page={ProPage} component={ProTimeline} content={children} componentParams={{ title: 'Pro Feed' }} /> | ||||||
| @ -180,10 +180,10 @@ class SwitchingArea extends PureComponent { | |||||||
|         <WrappedRoute path='/groups/browse/member' exact page={GroupsPage} component={GroupsCollection} content={children} componentParams={{ activeTab: 'member' }} /> |         <WrappedRoute path='/groups/browse/member' exact page={GroupsPage} component={GroupsCollection} content={children} componentParams={{ activeTab: 'member' }} /> | ||||||
|         <WrappedRoute path='/groups/browse/admin' exact page={GroupsPage} component={GroupsCollection} content={children} componentParams={{ activeTab: 'admin' }} /> |         <WrappedRoute path='/groups/browse/admin' exact page={GroupsPage} component={GroupsCollection} content={children} componentParams={{ activeTab: 'admin' }} /> | ||||||
| 
 | 
 | ||||||
|         <WrappedRoute path='/groups/create' page={ModalPage} component={GroupCreate} content={children} componentParams={{ title: 'Create Group' }} /> |         <WrappedRoute path='/groups/create' page={ModalPage} component={GroupCreate} content={children} componentParams={{ title: 'Create Group', page: 'create-group' }} /> | ||||||
|         { /* <WrappedRoute path='/groups/:id/members' page={GroupPage} component={GroupMembers} content={children} />  |         { /* <WrappedRoute path='/groups/:id/members' page={GroupPage} component={GroupMembers} content={children} />  | ||||||
|         <WrappedRoute path='/groups/:id/removed-accounts' page={GroupPage} component={GroupRemovedAccounts} content={children} />  */} |         <WrappedRoute path='/groups/:id/removed-accounts' page={GroupPage} component={GroupRemovedAccounts} content={children} />  */} | ||||||
|         <WrappedRoute path='/groups/:id/edit' page={ModalPage} component={GroupCreate} content={children} componentParams={{ title: 'Edit Group' }} /> |         <WrappedRoute path='/groups/:id/edit' page={ModalPage} component={GroupCreate} content={children} componentParams={{ title: 'Edit Group', page: 'edit-group' }} /> | ||||||
|         <WrappedRoute path='/groups/:id' page={GroupPage} component={GroupTimeline} content={children} /> |         <WrappedRoute path='/groups/:id' page={GroupPage} component={GroupTimeline} content={children} /> | ||||||
| 
 | 
 | ||||||
|         <WrappedRoute path='/tags/:id' publicRoute page={HashtagPage} component={HashtagTimeline} content={children} componentParams={{ title: 'Hashtag' }} /> |         <WrappedRoute path='/tags/:id' publicRoute page={HashtagPage} component={HashtagTimeline} content={children} componentParams={{ title: 'Hashtag' }} /> | ||||||
| @ -191,8 +191,8 @@ class SwitchingArea extends PureComponent { | |||||||
|         { /* <WrappedRoute path='/shortcuts' publicRoute page={ShortcutsPage} component={Shortcuts} content={children} /> */ } |         { /* <WrappedRoute path='/shortcuts' publicRoute page={ShortcutsPage} component={Shortcuts} content={children} /> */ } | ||||||
| 
 | 
 | ||||||
|         <WrappedRoute path='/lists' exact page={ListsPage} component={ListsDirectory} content={children} /> |         <WrappedRoute path='/lists' exact page={ListsPage} component={ListsDirectory} content={children} /> | ||||||
|         <WrappedRoute path='/lists/create' exact page={ModalPage} component={ListCreate} content={children} componentParams={{ title: 'Create List' }} /> |         <WrappedRoute path='/lists/create' exact page={ModalPage} component={ListCreate} content={children} componentParams={{ title: 'Create List', page: 'create-list' }} /> | ||||||
|         <WrappedRoute path='/lists/:id/edit' exact page={ModalPage} component={ListEdit} content={children} componentParams={{ title: 'Edit List' }} /> |         <WrappedRoute path='/lists/:id/edit' exact page={ModalPage} component={ListEdit} content={children} componentParams={{ title: 'Edit List', page: 'edit-list' }} /> | ||||||
|         <WrappedRoute path='/lists/:id' page={ListPage} component={ListTimeline} content={children} /> |         <WrappedRoute path='/lists/:id' page={ListPage} component={ListTimeline} content={children} /> | ||||||
| 
 | 
 | ||||||
|         <WrappedRoute path='/notifications' exact page={NotificationsPage} component={Notifications} content={children} /> |         <WrappedRoute path='/notifications' exact page={NotificationsPage} component={Notifications} content={children} /> | ||||||
| @ -229,7 +229,7 @@ class SwitchingArea extends PureComponent { | |||||||
|         <WrappedRoute path='/:username/likes' page={ProfilePage} component={LikedStatuses} content={children} /> |         <WrappedRoute path='/:username/likes' page={ProfilePage} component={LikedStatuses} content={children} /> | ||||||
| 
 | 
 | ||||||
|         <Redirect from='/@:username/posts/:statusId' to='/:username/posts/:statusId' exact /> |         <Redirect from='/@:username/posts/:statusId' to='/:username/posts/:statusId' exact /> | ||||||
|         <WrappedRoute path='/:username/posts/:statusId' publicRoute exact page={BasicPage} component={StatusFeature} content={children} componentParams={{ title: 'Status' }} /> |         <WrappedRoute path='/:username/posts/:statusId' publicRoute exact page={BasicPage} component={StatusFeature} content={children} componentParams={{ title: 'Status', page: 'status' }} /> | ||||||
| 
 | 
 | ||||||
|         { /* |         { /* | ||||||
|         <Redirect from='/@:username/posts/:statusId/reposts' to='/:username/posts/:statusId/reposts' /> |         <Redirect from='/@:username/posts/:statusId/reposts' to='/:username/posts/:statusId/reposts' /> | ||||||
|  | |||||||
| @ -6,9 +6,10 @@ export default class DefaultLayout extends PureComponent { | |||||||
|     actions: PropTypes.array, |     actions: PropTypes.array, | ||||||
|     children: PropTypes.node.isRequired, |     children: PropTypes.node.isRequired, | ||||||
|     layout: PropTypes.object, |     layout: PropTypes.object, | ||||||
|     showBackBtn: PropTypes.bool, |  | ||||||
|     noComposeButton: PropTypes.bool, |     noComposeButton: PropTypes.bool, | ||||||
|     noRightSidebar: PropTypes.bool, |     noRightSidebar: PropTypes.bool, | ||||||
|  |     page: PropTypes.string, | ||||||
|  |     showBackBtn: PropTypes.bool, | ||||||
|     tabs: PropTypes.array, |     tabs: PropTypes.array, | ||||||
|     title: PropTypes.string.isRequired, |     title: PropTypes.string.isRequired, | ||||||
|   } |   } | ||||||
| @ -18,22 +19,24 @@ export default class DefaultLayout extends PureComponent { | |||||||
|       actions, |       actions, | ||||||
|       children, |       children, | ||||||
|       layout, |       layout, | ||||||
|  |       noComposeButton, | ||||||
|  |       noRightSidebar, | ||||||
|  |       page, | ||||||
|       showBackBtn, |       showBackBtn, | ||||||
|       tabs, |       tabs, | ||||||
|       title, |       title, | ||||||
|       noComposeButton, |  | ||||||
|       noRightSidebar, |  | ||||||
|     } = this.props |     } = this.props | ||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|       <Layout |       <Layout | ||||||
|         actions={actions} |         actions={actions} | ||||||
|         layout={layout} |         layout={layout} | ||||||
|  |         noComposeButton={noComposeButton} | ||||||
|  |         noRightSidebar={noRightSidebar} | ||||||
|  |         page={page} | ||||||
|         showBackBtn={showBackBtn} |         showBackBtn={showBackBtn} | ||||||
|         tabs={tabs} |         tabs={tabs} | ||||||
|         title={title} |         title={title} | ||||||
|         noComposeButton={noComposeButton} |  | ||||||
|         noRightSidebar={noRightSidebar} |  | ||||||
|       > |       > | ||||||
|         {children} |         {children} | ||||||
|       </Layout> |       </Layout> | ||||||
|  | |||||||
| @ -8,6 +8,7 @@ import WhoToFollowPanel from '../components/panel/who_to_follow_panel' | |||||||
| import GroupSidebarPanel from '../components/panel/groups_panel' | import GroupSidebarPanel from '../components/panel/groups_panel' | ||||||
| import LinkFooter from '../components/link_footer' | import LinkFooter from '../components/link_footer' | ||||||
| import GroupHeader from '../components/group_header' | import GroupHeader from '../components/group_header' | ||||||
|  | import SidebarPanelGroup from '../components/sidebar_panel_group' | ||||||
| import Responsive from '../features/ui/util/responsive_component'; | import Responsive from '../features/ui/util/responsive_component'; | ||||||
| 
 | 
 | ||||||
| export default class GroupLayout extends ImmutablePureComponent { | export default class GroupLayout extends ImmutablePureComponent { | ||||||
| @ -16,6 +17,7 @@ export default class GroupLayout extends ImmutablePureComponent { | |||||||
|     actions: PropTypes.array, |     actions: PropTypes.array, | ||||||
|     children: PropTypes.node, |     children: PropTypes.node, | ||||||
|     group: ImmutablePropTypes.map, |     group: ImmutablePropTypes.map, | ||||||
|  |     groupId: PropTypes.string, | ||||||
|     layout: PropTypes.object, |     layout: PropTypes.object, | ||||||
|     relationships: ImmutablePropTypes.map, |     relationships: ImmutablePropTypes.map, | ||||||
|     showBackBtn: PropTypes.bool, |     showBackBtn: PropTypes.bool, | ||||||
| @ -27,6 +29,7 @@ export default class GroupLayout extends ImmutablePureComponent { | |||||||
|       actions, |       actions, | ||||||
|       children, |       children, | ||||||
|       group, |       group, | ||||||
|  |       groupId, | ||||||
|       layout, |       layout, | ||||||
|       relationships, |       relationships, | ||||||
|       showBackBtn, |       showBackBtn, | ||||||
| @ -40,6 +43,7 @@ export default class GroupLayout extends ImmutablePureComponent { | |||||||
|         actions={actions} |         actions={actions} | ||||||
|         showBackBtn={showBackBtn} |         showBackBtn={showBackBtn} | ||||||
|         title={title} |         title={title} | ||||||
|  |         page='group' | ||||||
|       > |       > | ||||||
|         <Responsive max={BREAKPOINT_EXTRA_SMALL}> |         <Responsive max={BREAKPOINT_EXTRA_SMALL}> | ||||||
|           <div className={[_s.default, _s.width100PC].join(' ')}> |           <div className={[_s.default, _s.width100PC].join(' ')}> | ||||||
| @ -70,10 +74,15 @@ export default class GroupLayout extends ImmutablePureComponent { | |||||||
|               <div className={[_s.default, _s.ml15, _s.width340PX].join(' ')}> |               <div className={[_s.default, _s.ml15, _s.width340PX].join(' ')}> | ||||||
|                 <Sticky top={73} enabled> |                 <Sticky top={73} enabled> | ||||||
|                   <div className={[_s.default, _s.width340PX].join(' ')}> |                   <div className={[_s.default, _s.width340PX].join(' ')}> | ||||||
|                     <GroupInfoPanel group={group} /> |                     <SidebarPanelGroup | ||||||
|                     <WhoToFollowPanel /> |                       page={`group.${groupId}`} | ||||||
|                     <GroupSidebarPanel isSlim /> |                       layout={[ | ||||||
|                     <LinkFooter /> |                         <GroupInfoPanel group={group} key='group-page-info-panel' />, | ||||||
|  |                         <WhoToFollowPanel key='group-page-wtf-panel' />, | ||||||
|  |                         <GroupSidebarPanel isSlim key='group-page-group-panel' />, | ||||||
|  |                         <LinkFooter key='group-page-link-footer' />, | ||||||
|  |                       ]} | ||||||
|  |                     /> | ||||||
|                   </div> |                   </div> | ||||||
|                 </Sticky> |                 </Sticky> | ||||||
|               </div> |               </div> | ||||||
|  | |||||||
| @ -6,6 +6,7 @@ import { | |||||||
| import { me } from '../initial_state' | import { me } from '../initial_state' | ||||||
| import Sidebar from '../components/sidebar' | import Sidebar from '../components/sidebar' | ||||||
| import SidebarXS from '../components/sidebar_xs' | import SidebarXS from '../components/sidebar_xs' | ||||||
|  | import SidebarPanelGroup from '../components/sidebar_panel_group' | ||||||
| import NavigationBar from '../components/navigation_bar' | import NavigationBar from '../components/navigation_bar' | ||||||
| import LoggedOutNavigationBar from '../components/logged_out_navigation_bar' | import LoggedOutNavigationBar from '../components/logged_out_navigation_bar' | ||||||
| import FooterBar from '../components/footer_bar' | import FooterBar from '../components/footer_bar' | ||||||
| @ -19,10 +20,11 @@ export default class Layout extends PureComponent { | |||||||
|   static propTypes = { |   static propTypes = { | ||||||
|     actions: PropTypes.array, |     actions: PropTypes.array, | ||||||
|     children: PropTypes.node, |     children: PropTypes.node, | ||||||
|     layout: PropTypes.object, |     layout: PropTypes.array, | ||||||
|     noComposeButton: PropTypes.bool, |     noComposeButton: PropTypes.bool, | ||||||
|     noRightSidebar: PropTypes.bool, |     noRightSidebar: PropTypes.bool, | ||||||
|     noSidebar: PropTypes.bool, |     noSidebar: PropTypes.bool, | ||||||
|  |     page: PropTypes.string, | ||||||
|     showBackBtn: PropTypes.bool, |     showBackBtn: PropTypes.bool, | ||||||
|     tabs: PropTypes.array, |     tabs: PropTypes.array, | ||||||
|     title: PropTypes.string, |     title: PropTypes.string, | ||||||
| @ -36,6 +38,7 @@ export default class Layout extends PureComponent { | |||||||
|       noComposeButton, |       noComposeButton, | ||||||
|       noRightSidebar, |       noRightSidebar, | ||||||
|       noSidebar, |       noSidebar, | ||||||
|  |       page, | ||||||
|       showBackBtn, |       showBackBtn, | ||||||
|       tabs, |       tabs, | ||||||
|       title, |       title, | ||||||
| @ -126,7 +129,7 @@ export default class Layout extends PureComponent { | |||||||
|                     <div className={[_s.default, _s.width340PX, _s.ml15].join(' ')}> |                     <div className={[_s.default, _s.width340PX, _s.ml15].join(' ')}> | ||||||
|                       <Sticky top={73} enabled> |                       <Sticky top={73} enabled> | ||||||
|                         <div className={[_s.default, _s.width340PX].join(' ')}> |                         <div className={[_s.default, _s.width340PX].join(' ')}> | ||||||
|                           {layout} |                           <SidebarPanelGroup layout={layout} page={page} /> | ||||||
|                         </div> |                         </div> | ||||||
|                       </Sticky> |                       </Sticky> | ||||||
|                     </div> |                     </div> | ||||||
|  | |||||||
| @ -16,6 +16,7 @@ export default class AboutPage extends PureComponent { | |||||||
|         noComposeButton |         noComposeButton | ||||||
|         showBackBtn |         showBackBtn | ||||||
|         title={title} |         title={title} | ||||||
|  |         page='about' | ||||||
|       > |       > | ||||||
|         <PageTitle path={title} /> |         <PageTitle path={title} /> | ||||||
|         {children} |         {children} | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import PageTitle from '../features/ui/util/page_title' | import PageTitle from '../features/ui/util/page_title' | ||||||
| import DefaultLayout from '../layouts/default_layout' | import DefaultLayout from '../layouts/default_layout' | ||||||
| import LinkFooter from '../components/link_footer' | 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 { | export default class BasicPage extends PureComponent { | ||||||
| 
 | 
 | ||||||
|   static propTypes = { |   static propTypes = { | ||||||
|     title: PropTypes.string.isRequired, |  | ||||||
|     children: PropTypes.node.isRequired, |     children: PropTypes.node.isRequired, | ||||||
|  |     page: PropTypes.string.isRequired, | ||||||
|  |     title: PropTypes.string.isRequired, | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     const { children, title } = this.props |     const { | ||||||
|  |       children, | ||||||
|  |       page, | ||||||
|  |       title, | ||||||
|  |     } = this.props | ||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|         noComposeButton |         noComposeButton | ||||||
|         showBackBtn |         showBackBtn | ||||||
|         title={title} |         title={title} | ||||||
|         layout={( |         page={page} | ||||||
|           <Fragment> |         layout={[ | ||||||
|             <TrendsPanel /> |           <TrendsPanel key='basic-page-trends-panel' />, | ||||||
|             <WhoToFollowPanel /> |           <WhoToFollowPanel key='basic-page-wtf-panel' />, | ||||||
|             <LinkFooter /> |           <LinkFooter key='basic-page-link-footer' />, | ||||||
|           </Fragment> |         ]} | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
|         <PageTitle path={title} /> |         <PageTitle path={title} /> | ||||||
|         {children} |         {children} | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
| import { openModal } from '../actions/modal' | import { openModal } from '../actions/modal' | ||||||
| import PageTitle from '../features/ui/util/page_title' | import PageTitle from '../features/ui/util/page_title' | ||||||
| @ -38,21 +37,20 @@ class CommunityPage extends PureComponent { | |||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|         title={title} |         title={title} | ||||||
|  |         page='community' | ||||||
|         actions={[ |         actions={[ | ||||||
|           { |           { | ||||||
|             icon: 'ellipsis', |             icon: 'ellipsis', | ||||||
|             onClick: onOpenCommunityPageSettingsModal, |             onClick: onOpenCommunityPageSettingsModal, | ||||||
|           }, |           }, | ||||||
|         ]} |         ]} | ||||||
|         layout={( |         layout={[ | ||||||
|           <Fragment> |           <ProgressPanel key='community-page-progress-panel' />, | ||||||
|             <ProgressPanel /> |           <TrendsPanel key='community-page-progress-panel' />, | ||||||
|             <TrendsPanel /> |           <WhoToFollowPanel key='community-page-wtf-panel' />, | ||||||
|             <WhoToFollowPanel /> |           <GroupSidebarPanel key='community-page-groups-panel' />, | ||||||
|             <GroupSidebarPanel /> |           <LinkFooter key='community-page-link-footer' />, | ||||||
|             <LinkFooter /> |         ]} | ||||||
|           </Fragment> |  | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
|         <PageTitle path={title} /> |         <PageTitle path={title} /> | ||||||
|         {children} |         {children} | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import PageTitle from '../features/ui/util/page_title' | import PageTitle from '../features/ui/util/page_title' | ||||||
| import DefaultLayout from '../layouts/default_layout' | import DefaultLayout from '../layouts/default_layout' | ||||||
| import ProgressPanel from '../components/panel/progress_panel' | import ProgressPanel from '../components/panel/progress_panel' | ||||||
| @ -18,17 +17,16 @@ export default class ExplorePage extends PureComponent { | |||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|  |         page='explore' | ||||||
|         title={title} |         title={title} | ||||||
|         noComposeButton |         noComposeButton | ||||||
|         showBackBtn |         showBackBtn | ||||||
|         layout={( |         layout={[ | ||||||
|           <Fragment> |           <ProgressPanel key='explore-page-progress-panel' />, | ||||||
|             <ProgressPanel /> |           <VerifiedAccountsPanel key='explore-page-verified-panel' />, | ||||||
|             <VerifiedAccountsPanel /> |           <ShopPanel key='explore-page-shop-panel' />, | ||||||
|             <ShopPanel /> |           <LinkFooter key='explore-page-link-footer' />, | ||||||
|             <LinkFooter /> |         ]} | ||||||
|           </Fragment> |  | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
|         <PageTitle path={title} /> |         <PageTitle path={title} /> | ||||||
|         {children} |         {children} | ||||||
|  | |||||||
| @ -56,6 +56,7 @@ class GroupPage extends ImmutablePureComponent { | |||||||
| 				showBackBtn | 				showBackBtn | ||||||
| 				title={groupTitle} | 				title={groupTitle} | ||||||
| 				group={group} | 				group={group} | ||||||
|  | 				groupId={groupId} | ||||||
| 				relationships={relationships} | 				relationships={relationships} | ||||||
| 			> | 			> | ||||||
| 				<PageTitle path={[groupTitle, intl.formatMessage(messages.group)]} /> | 				<PageTitle path={[groupTitle, intl.formatMessage(messages.group)]} /> | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import { me } from '../initial_state' | import { me } from '../initial_state' | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
| import { openModal } from '../actions/modal' | import { openModal } from '../actions/modal' | ||||||
| @ -93,13 +92,12 @@ class GroupsPage extends PureComponent { | |||||||
|         title={title} |         title={title} | ||||||
|         actions={actions} |         actions={actions} | ||||||
|         tabs={tabs} |         tabs={tabs} | ||||||
|         layout={( |         page='groups' | ||||||
|           <Fragment> |         layout={[ | ||||||
|             <WhoToFollowPanel /> |           <WhoToFollowPanel key='groups-page-wtf-panel' />, | ||||||
|             <GroupsPanel slim /> |           <GroupsPanel slim key='groups-page-groups-panel' />, | ||||||
|             <LinkFooter /> |           <LinkFooter key='groups-page-link-footer' />, | ||||||
|           </Fragment> |         ]} | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
|         <PageTitle path={title} /> |         <PageTitle path={title} /> | ||||||
|         { children } |         { children } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import { openModal } from '../actions/modal' | import { openModal } from '../actions/modal' | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
|  | import isObject from 'lodash.isobject' | ||||||
| import PageTitle from '../features/ui/util/page_title' | import PageTitle from '../features/ui/util/page_title' | ||||||
| import LinkFooter from '../components/link_footer' | import LinkFooter from '../components/link_footer' | ||||||
| import WhoToFollowPanel from '../components/panel/who_to_follow_panel' | import WhoToFollowPanel from '../components/panel/who_to_follow_panel' | ||||||
| @ -30,6 +30,7 @@ class HashtagPage extends PureComponent { | |||||||
|     intl: PropTypes.object.isRequired, |     intl: PropTypes.object.isRequired, | ||||||
|     children: PropTypes.node.isRequired, |     children: PropTypes.node.isRequired, | ||||||
|     onOpenHashtagPageSettingsModal: PropTypes.func.isRequired, |     onOpenHashtagPageSettingsModal: PropTypes.func.isRequired, | ||||||
|  |     params: PropTypes.object.isRequired, | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
| @ -37,25 +38,27 @@ class HashtagPage extends PureComponent { | |||||||
|       intl, |       intl, | ||||||
|       children, |       children, | ||||||
|       onOpenHashtagPageSettingsModal, |       onOpenHashtagPageSettingsModal, | ||||||
|  |       params, | ||||||
|     } = this.props |     } = this.props | ||||||
| 
 | 
 | ||||||
|  |     const hashtag = isObject(params) ? params.id : '' | ||||||
|  | 
 | ||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|         title={intl.formatMessage(messages.hashtagTimeline)} |         title={intl.formatMessage(messages.hashtagTimeline)} | ||||||
|  |         page={`hashtag.${hashtag}`} | ||||||
|         actions={[ |         actions={[ | ||||||
|           { |           { | ||||||
|             icon: 'ellipsis', |             icon: 'ellipsis', | ||||||
|             onClick: onOpenHashtagPageSettingsModal, |             onClick: onOpenHashtagPageSettingsModal, | ||||||
|           }, |           }, | ||||||
|         ]} |         ]} | ||||||
|         layout={( |         layout={[ | ||||||
|           <Fragment> |           <ProgressPanel key='hashtag-page-progress-panel' />, | ||||||
|             <ProgressPanel /> |           <TrendsPanel key='hashtag-page-trends-panel' />, | ||||||
|             <TrendsPanel /> |           <WhoToFollowPanel key='hashtag-page-wtf-panel' />, | ||||||
|             <WhoToFollowPanel /> |           <LinkFooter key='hashtag-page-link-footer' />, | ||||||
|             <LinkFooter /> |         ]} | ||||||
|           </Fragment> |  | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
|         <PageTitle path={intl.formatMessage(messages.hashtag)} /> |         <PageTitle path={intl.formatMessage(messages.hashtag)} /> | ||||||
|         {children} |         {children} | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import throttle from 'lodash.throttle' | import throttle from 'lodash.throttle' | ||||||
| import { openModal } from '../actions/modal' | import { openModal } from '../actions/modal' | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
| @ -91,6 +90,7 @@ class HomePage extends PureComponent { | |||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|  |         page='home' | ||||||
|         title={intl.formatMessage(messages.home)} |         title={intl.formatMessage(messages.home)} | ||||||
|         actions={[ |         actions={[ | ||||||
|           { |           { | ||||||
| @ -98,19 +98,17 @@ class HomePage extends PureComponent { | |||||||
|             onClick: onOpenHomePageSettingsModal, |             onClick: onOpenHomePageSettingsModal, | ||||||
|           }, |           }, | ||||||
|         ]} |         ]} | ||||||
|         layout={( |         layout={[ | ||||||
|           <Fragment> |           <UserPanel key='home-page-user-panel' />, | ||||||
|             <UserPanel /> |           <ProgressPanel key='home-page-progress-panel' />, | ||||||
|             <ProgressPanel /> |           <ProPanel isPro={isPro} key='home-page-pro-panel' />, | ||||||
|             <ProPanel isPro={isPro} /> |           <TrendsPanel key='home-page-trends-panel' />, | ||||||
|             <TrendsPanel /> |           <ShopPanel isLazy shouldLoad={lazyLoaded} key='home-page-shop-panel' />, | ||||||
|             <ShopPanel isLazy shouldLoad={lazyLoaded} /> |           <ListsPanel isLazy shouldLoad={lazyLoaded} key='home-page-lists-panel' />, | ||||||
|             <ListsPanel isLazy shouldLoad={lazyLoaded} /> |           <WhoToFollowPanel isLazy shouldLoad={lazyLoaded} key='home-page-wtf-panel' />, | ||||||
|             <WhoToFollowPanel isLazy shouldLoad={lazyLoaded} /> |           <GroupsPanel isLazy shouldLoad={lazyLoaded} key='home-page-groups-panel' />, | ||||||
|             <GroupsPanel isLazy shouldLoad={lazyLoaded} /> |           <LinkFooter key='home-page-link-footer' />, | ||||||
|             <LinkFooter /> |         ]} | ||||||
|           </Fragment> |  | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
| 
 | 
 | ||||||
|         <PageTitle |         <PageTitle | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import ImmutablePropTypes from 'react-immutable-proptypes' | import ImmutablePropTypes from 'react-immutable-proptypes' | ||||||
| import ImmutablePureComponent from 'react-immutable-pure-component' | import ImmutablePureComponent from 'react-immutable-pure-component' | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
| @ -66,6 +65,7 @@ class ListPage extends ImmutablePureComponent { | |||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|         showBackBtn |         showBackBtn | ||||||
|         title={intl.formatMessage(messages.list)} |         title={intl.formatMessage(messages.list)} | ||||||
|  |         page='list' | ||||||
|         actions={[ |         actions={[ | ||||||
|           { |           { | ||||||
|             icon: 'cog', |             icon: 'cog', | ||||||
| @ -76,14 +76,12 @@ class ListPage extends ImmutablePureComponent { | |||||||
|           //   onClick: onOpenListTimelineSettingsModal,
 |           //   onClick: onOpenListTimelineSettingsModal,
 | ||||||
|           // },
 |           // },
 | ||||||
|         ]} |         ]} | ||||||
|         layout={( |         layout={[ | ||||||
|           <Fragment> |           <ListDetailsPanel list={list} onEdit={this.handleOnOpenListEditModal} key='list-page-list-panel' />, | ||||||
|             <ListDetailsPanel list={list} onEdit={this.handleOnOpenListEditModal} /> |           <TrendsPanel key='list-page-trends-panel' />, | ||||||
|             <TrendsPanel /> |           <WhoToFollowPanel key='list-page-wtf-panel' />, | ||||||
|             <WhoToFollowPanel /> |           <LinkFooter key='list-page-link-footer' />, | ||||||
|             <LinkFooter /> |         ]} | ||||||
|           </Fragment> |  | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
|         <PageTitle path={[title, intl.formatMessage(messages.list)]} /> |         <PageTitle path={[title, intl.formatMessage(messages.list)]} /> | ||||||
|         { children } |         { children } | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import { openModal } from '../actions/modal' | import { openModal } from '../actions/modal' | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
| import PageTitle from '../features/ui/util/page_title' | import PageTitle from '../features/ui/util/page_title' | ||||||
| @ -38,19 +37,18 @@ class ListsPage extends PureComponent { | |||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|         title={intl.formatMessage(messages.lists)} |         title={intl.formatMessage(messages.lists)} | ||||||
|  |         page='lists' | ||||||
|         actions={[ |         actions={[ | ||||||
|           { |           { | ||||||
|             icon: 'add', |             icon: 'add', | ||||||
|             onClick: onOpenListCreateModal, |             onClick: onOpenListCreateModal, | ||||||
|           }, |           }, | ||||||
|         ]} |         ]} | ||||||
|         layout={( |         layout={[ | ||||||
|           <Fragment> |           <TrendsPanel key='lists-page-trends-panel' />, | ||||||
|             <TrendsPanel /> |           <WhoToFollowPanel key='lists-page-wtf-panel' />, | ||||||
|             <WhoToFollowPanel /> |           <LinkFooter key='lists-page-link-footer' />, | ||||||
|             <LinkFooter /> |         ]} | ||||||
|           </Fragment> |  | ||||||
|         )} |  | ||||||
|         showBackBtn |         showBackBtn | ||||||
|       > |       > | ||||||
|         <PageTitle path={intl.formatMessage(messages.lists)} /> |         <PageTitle path={intl.formatMessage(messages.lists)} /> | ||||||
|  | |||||||
| @ -1,27 +1,31 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import PageTitle from '../features/ui/util/page_title' | import PageTitle from '../features/ui/util/page_title' | ||||||
| import LinkFooter from '../components/link_footer' | import LinkFooter from '../components/link_footer' | ||||||
| import WhoToFollowPanel from '../components/panel/who_to_follow_panel' | import WhoToFollowPanel from '../components/panel/who_to_follow_panel' | ||||||
| import DefaultLayout from '../layouts/default_layout' | import DefaultLayout from '../layouts/default_layout' | ||||||
| 
 | 
 | ||||||
| export default class ModalPage extends PureComponent { | export default class ModalPage extends PureComponent { | ||||||
|  | 
 | ||||||
|   static propTypes = { |   static propTypes = { | ||||||
|     title: PropTypes.string, |     title: PropTypes.string, | ||||||
|  |     page: PropTypes.string, | ||||||
|     children: PropTypes.node, |     children: PropTypes.node, | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     const { children, title } = this.props |     const { | ||||||
|  |       children, | ||||||
|  |       title, | ||||||
|  |       page, | ||||||
|  |     } = this.props | ||||||
| 
 | 
 | ||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|         title={title} |         title={title} | ||||||
|         layout={( |         page={page} | ||||||
|           <Fragment> |         layout={[ | ||||||
|             <WhoToFollowPanel /> |           <WhoToFollowPanel key='modal-page-wtf-panel' />, | ||||||
|             <LinkFooter /> |           <LinkFooter key='search-page-link-footer' />, | ||||||
|           </Fragment> |         ]} | ||||||
|         )} |  | ||||||
|         showBackBtn |         showBackBtn | ||||||
|       > |       > | ||||||
|         <PageTitle path={title} /> |         <PageTitle path={title} /> | ||||||
| @ -29,4 +33,5 @@ export default class ModalPage extends PureComponent { | |||||||
|       </DefaultLayout> |       </DefaultLayout> | ||||||
|     ) |     ) | ||||||
|   } |   } | ||||||
|  | 
 | ||||||
| } | } | ||||||
| @ -1,4 +1,4 @@ | |||||||
| import { Fragment } from 'react' | 
 | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
| import { setFilter } from '../actions/notifications' | import { setFilter } from '../actions/notifications' | ||||||
| import { me } from '../initial_state' | import { me } from '../initial_state' | ||||||
| @ -86,14 +86,13 @@ class NotificationsPage extends PureComponent { | |||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|         title={intl.formatMessage(messages.notifications)} |         title={intl.formatMessage(messages.notifications)} | ||||||
|         layout={( |         page='notifications' | ||||||
|           <Fragment> |         layout={[ | ||||||
|             <NotificationFilterPanel /> |           <NotificationFilterPanel key='notification-page-filter-panel' />, | ||||||
|             <TrendsPanel /> |           <TrendsPanel key='notification-page-trends-panel' />, | ||||||
|             <WhoToFollowPanel /> |           <WhoToFollowPanel key='notification-page-wtf-panel' />, | ||||||
|             <LinkFooter /> |           <LinkFooter key='notification-page-link-footer' />, | ||||||
|           </Fragment> |         ]} | ||||||
|         )} |  | ||||||
|         tabs={tabs} |         tabs={tabs} | ||||||
|       > |       > | ||||||
|         <PageTitle |         <PageTitle | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
| import PageTitle from '../features/ui/util/page_title' | import PageTitle from '../features/ui/util/page_title' | ||||||
| import LinkFooter from '../components/link_footer' | import LinkFooter from '../components/link_footer' | ||||||
| @ -27,13 +26,12 @@ class ProPage extends PureComponent { | |||||||
|     return ( |     return ( | ||||||
|       <DefaultLayout |       <DefaultLayout | ||||||
|         title={title} |         title={title} | ||||||
|         layout={( |         page='pro' | ||||||
|           <Fragment> |         layout={[ | ||||||
|             <ProgressPanel /> |           <ProgressPanel key='pro-page-progress-panel' />, | ||||||
|             <VerifiedAccountsPanel /> |           <VerifiedAccountsPanel key='pro-page-verified-panel' />, | ||||||
|             <LinkFooter /> |           <LinkFooter key='pro-page-link-footer' />, | ||||||
|           </Fragment> |         ]} | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
|         <PageTitle path={title} /> |         <PageTitle path={title} /> | ||||||
|         {children} |         {children} | ||||||
|  | |||||||
| @ -1,4 +1,3 @@ | |||||||
| import { Fragment } from 'react' |  | ||||||
| import { defineMessages, injectIntl } from 'react-intl' | import { defineMessages, injectIntl } from 'react-intl' | ||||||
| import { BREAKPOINT_EXTRA_SMALL } from '../constants' | import { BREAKPOINT_EXTRA_SMALL } from '../constants' | ||||||
| import Responsive from '../features/ui/util/responsive_component' | import Responsive from '../features/ui/util/responsive_component' | ||||||
| @ -17,17 +16,23 @@ const messages = defineMessages({ | |||||||
|   hashtags: { id: 'hashtags', defaultMessage: 'Hashtags' }, |   hashtags: { id: 'hashtags', defaultMessage: 'Hashtags' }, | ||||||
| }) | }) | ||||||
| 
 | 
 | ||||||
|  | const mapStateToProps = (state) => ({ | ||||||
|  |   value: state.getIn(['search', 'value']), | ||||||
|  | }) | ||||||
|  | 
 | ||||||
| export default | export default | ||||||
| @injectIntl | @injectIntl | ||||||
|  | @connect(mapStateToProps) | ||||||
| class SearchPage extends PureComponent { | class SearchPage extends PureComponent { | ||||||
| 
 | 
 | ||||||
|   static propTypes = { |   static propTypes = { | ||||||
|     intl: PropTypes.object.isRequired, |     intl: PropTypes.object.isRequired, | ||||||
|     children: PropTypes.node.isRequired, |     children: PropTypes.node.isRequired, | ||||||
|  |     value: PropTypes.string, | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     const { intl, children } = this.props |     const { intl, children, value } = this.props | ||||||
| 
 | 
 | ||||||
|     const title = intl.formatMessage(messages.search) |     const title = intl.formatMessage(messages.search) | ||||||
|     const tabs = [ |     const tabs = [ | ||||||
| @ -49,19 +54,20 @@ class SearchPage extends PureComponent { | |||||||
|       }, |       }, | ||||||
|     ] |     ] | ||||||
| 
 | 
 | ||||||
|  |     const qos = !!value ? value : '' | ||||||
|  | 
 | ||||||
|     return ( |     return ( | ||||||
|       <Layout |       <Layout | ||||||
|         noComposeButton |         noComposeButton | ||||||
|         title={title} |         title={title} | ||||||
|         showBackBtn |         showBackBtn | ||||||
|         tabs={tabs} |         tabs={tabs} | ||||||
|         layout={( |         page={`search.${qos}`} | ||||||
|           <Fragment> |         layout={[ | ||||||
|             <SearchFilterPanel /> |           <SearchFilterPanel key='search-page-search-panel' />, | ||||||
|             <TrendsPanel /> |           <TrendsPanel key='search-page-trends-panel' />, | ||||||
|             <LinkFooter /> |           <LinkFooter key='search-page-link-footer' />, | ||||||
|           </Fragment> |         ]} | ||||||
|         )} |  | ||||||
|       > |       > | ||||||
|         <PageTitle path={title} /> |         <PageTitle path={title} /> | ||||||
|          |          | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 mgabdev
						mgabdev