revert browser newux changes (#5714)

This commit is contained in:
Kanagaraj M
2018-03-27 01:19:12 +05:30
committed by Dee Koder
parent 35e64573fa
commit 19451e374a
186 changed files with 4507 additions and 16033 deletions

View File

@@ -17,28 +17,14 @@
import React from "react"
import { connect } from "react-redux"
import { Scrollbars } from "react-custom-scrollbars"
import InfiniteScroll from "react-infinite-scroller"
import * as actionsBuckets from "./actions"
import { getFilteredBuckets } from "./selectors"
import { getVisibleBuckets } from "./selectors"
import BucketContainer from "./BucketContainer"
import web from "../web"
import history from "../history"
import { pathSlice } from "../utils"
export class BucketList extends React.Component {
constructor(props) {
super(props)
this.state = {
page: 1
}
}
componentWillReceiveProps(nexProps) {
if (this.props.filter != nexProps.filter) {
this.setState({
page: 1
})
}
}
componentWillMount() {
const { fetchBuckets, setBucketList, selectBucket } = this.props
if (web.LoggedIn()) {
@@ -53,29 +39,19 @@ export class BucketList extends React.Component {
}
}
}
loadNextPage() {
this.setState({
page: this.state.page + 1
})
}
render() {
const { filteredBuckets } = this.props
const visibleBuckets = filteredBuckets.slice(0, this.state.page * 100)
const { visibleBuckets } = this.props
return (
<div className="buckets__list">
<InfiniteScroll
pageStart={0}
loadMore={this.loadNextPage.bind(this)}
hasMore={filteredBuckets.length > visibleBuckets.length}
useWindow={false}
element="div"
initialLoad={false}
className="buckets__scroll"
<div className="fesl-inner">
<Scrollbars
renderTrackVertical={props => <div className="scrollbar-vertical" />}
>
{visibleBuckets.map(bucket => (
<BucketContainer key={bucket} bucket={bucket} />
))}
</InfiniteScroll>
<ul>
{visibleBuckets.map(bucket => (
<BucketContainer key={bucket} bucket={bucket} />
))}
</ul>
</Scrollbars>
</div>
)
}
@@ -83,8 +59,7 @@ export class BucketList extends React.Component {
const mapStateToProps = state => {
return {
filteredBuckets: getFilteredBuckets(state),
filter: state.buckets.filter
visibleBuckets: getVisibleBuckets(state)
}
}