This commit is contained in:
mgabdev
2020-05-08 22:17:19 -04:00
parent a390662e4f
commit b620cb1372
38 changed files with 734 additions and 277 deletions

View File

@@ -4,11 +4,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import { fetchGroup } from '../actions/groups'
import PageTitle from '../features/ui/util/page_title'
import GroupInfoPanel from '../components/panel/group_info_panel'
import GroupLayout from '../layouts/group_layout'
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
import GroupSidebarPanel from '../components/panel/groups_panel'
import LinkFooter from '../components/link_footer'
import TimelineComposeBlock from '../components/timeline_compose_block'
import Divider from '../components/divider'
@@ -21,8 +17,10 @@ const mapStateToProps = (state, { params: { id } }) => ({
relationships: state.getIn(['group_relationships', id]),
})
const mapDispatchToProps = () => ({
fetchGroup,
const mapDispatchToProps = (dispatch) => ({
onFetchGroup(groupId) {
dispatch(fetchGroup(groupId))
}
})
export default
@@ -35,11 +33,12 @@ class GroupPage extends ImmutablePureComponent {
group: ImmutablePropTypes.map,
children: PropTypes.node.isRequired,
relationships: ImmutablePropTypes.map,
fetchGroup: PropTypes.func.isRequired,
onFetchGroup: PropTypes.func.isRequired,
}
componentDidMount() {
this.props.fetchGroup(this.props.params.id)
console.log("group page mounted:", this.props.params.id)
this.props.onFetchGroup(this.props.params.id)
}
render() {
@@ -65,14 +64,6 @@ class GroupPage extends ImmutablePureComponent {
// onClick: null,
// },
]}
layout={(
<Fragment>
<GroupInfoPanel group={group} />
<WhoToFollowPanel />
<GroupSidebarPanel isSlim />
<LinkFooter />
</Fragment>
)}
>
<PageTitle path={[groupTitle, intl.formatMessage(messages.group)]} />

View File

@@ -2,8 +2,8 @@ import { Fragment } from 'react'
import { openModal } from '../actions/modal'
import { defineMessages, injectIntl } from 'react-intl'
import { MODAL_HOME_TIMELINE_SETTINGS } from '../constants'
import IntersectionObserverArticle from '../components/intersection_observer_article'
import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper'
// import IntersectionObserverArticle from '../components/intersection_observer_article'
// import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper'
import PageTitle from '../features/ui/util/page_title'
import GroupsPanel from '../components/panel/groups_panel'
import ListsPanel from '../components/panel/lists_panel'
@@ -43,23 +43,23 @@ class HomePage extends PureComponent {
totalQueuedItemsCount: PropTypes.number.isRequired,
}
intersectionObserverWrapper = new IntersectionObserverWrapper()
// intersectionObserverWrapper = new IntersectionObserverWrapper()
componentDidMount() {
this.attachIntersectionObserver()
}
// componentDidMount() {
// this.attachIntersectionObserver()
// }
componentWillUnmount() {
this.detachIntersectionObserver()
}
// componentWillUnmount() {
// this.detachIntersectionObserver()
// }
attachIntersectionObserver() {
this.intersectionObserverWrapper.connect()
}
// attachIntersectionObserver() {
// this.intersectionObserverWrapper.connect()
// }
detachIntersectionObserver() {
this.intersectionObserverWrapper.disconnect()
}
// detachIntersectionObserver() {
// this.intersectionObserverWrapper.disconnect()
// }
render() {
const {
@@ -87,30 +87,9 @@ class HomePage extends PureComponent {
<UserPanel />
<ProgressPanel />
<TrendsPanel />
<IntersectionObserverArticle
id={'home-sidebar-lists-panel'}
listLength={7}
index={4}
intersectionObserverWrapper={this.intersectionObserverWrapper}
>
<ListsPanel />
</IntersectionObserverArticle>
<IntersectionObserverArticle
id={'home-sidebar-wtf-panel'}
listLength={7}
index={5}
intersectionObserverWrapper={this.intersectionObserverWrapper}
>
<WhoToFollowPanel />
</IntersectionObserverArticle>
<IntersectionObserverArticle
id={'home-sidebar-groups-panel'}
listLength={7}
index={6}
intersectionObserverWrapper={this.intersectionObserverWrapper}
>
<GroupsPanel isLazy />
</IntersectionObserverArticle>
<ListsPanel />
<WhoToFollowPanel />
<GroupsPanel />
<LinkFooter />
</Fragment>
)}

View File

@@ -35,6 +35,7 @@ const mapStateToProps = (state) => ({
const mapDispatchToProps = (dispatch) => ({
setFilter(value) {
console.log("SETTING ACTIVE FILTER:", value)
dispatch(setFilter('active', value))
},
})
@@ -56,7 +57,9 @@ class NotificationsPage extends PureComponent {
selectedFilter: PropTypes.string.isRequired,
}
componentDidMount() {
componentWill
UNSAFE_componentWillMount() {
this.checkForQueryStringChange(this.context.router.route.location)
}

View File

@@ -5,10 +5,6 @@ import { fetchAccountByUsername } from '../actions/accounts'
import { makeGetAccount } from '../selectors'
import { me } from '../initial_state'
import PageTitle from '../features/ui/util/page_title'
import LinkFooter from '../components/link_footer'
import ProfileStatsPanel from '../components/panel/profile_stats_panel'
import ProfileInfoPanel from '../components/panel/profile_info_panel'
import MediaGalleryPanel from '../components/panel/media_gallery_panel'
import ColumnIndicator from '../components/column_indicator'
import ProfileLayout from '../layouts/profile_layout'
@@ -66,14 +62,7 @@ class ProfilePage extends ImmutablePureComponent {
return (
<ProfileLayout
account={account}
layout={(
<Fragment>
<ProfileStatsPanel account={account} />
<ProfileInfoPanel account={account} />
{ !unavailable && <MediaGalleryPanel account={account} /> }
<LinkFooter />
</Fragment>
)}
title={name}
>
<PageTitle path={`${name} (@${username})`} />
{

View File

@@ -5,6 +5,7 @@ import Responsive from '../features/ui/util/responsive_component'
import PageTitle from '../features/ui/util/page_title'
import LinkFooter from '../components/link_footer'
import SearchFilterPanel from '../components/panel/search_filter_panel'
import TrendsPanel from '../components/panel/trends_panel'
import Search from '../components/search'
import Layout from '../layouts/layout'
@@ -57,6 +58,7 @@ class SearchPage extends PureComponent {
layout={(
<Fragment>
<SearchFilterPanel />
<TrendsPanel />
<LinkFooter />
</Fragment>
)}