Remove Neo4J
This commit is contained in:
parent
fca183968e
commit
8efa081f21
23 changed files with 6 additions and 323 deletions
|
@ -1,86 +0,0 @@
|
|||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import AccountContainer from '../../../containers/account_container';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
const outerStyle = {
|
||||
position: 'relative'
|
||||
};
|
||||
|
||||
const headerStyle = {
|
||||
fontSize: '14px',
|
||||
fontWeight: '500',
|
||||
display: 'block',
|
||||
padding: '10px',
|
||||
color: '#9baec8',
|
||||
background: '#454b5e',
|
||||
overflow: 'hidden'
|
||||
};
|
||||
|
||||
const nextStyle = {
|
||||
display: 'inline-block',
|
||||
float: 'right',
|
||||
fontWeight: '400',
|
||||
color: '#2b90d9'
|
||||
};
|
||||
|
||||
const SuggestionsBox = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
accountIds: ImmutablePropTypes.list,
|
||||
perWindow: React.PropTypes.number
|
||||
},
|
||||
|
||||
getInitialState () {
|
||||
return {
|
||||
index: 0
|
||||
};
|
||||
},
|
||||
|
||||
getDefaultProps () {
|
||||
return {
|
||||
perWindow: 2
|
||||
};
|
||||
},
|
||||
|
||||
mixins: [PureRenderMixin],
|
||||
|
||||
handleNextClick (e) {
|
||||
e.preventDefault();
|
||||
|
||||
let newIndex = this.state.index + 1;
|
||||
|
||||
if (this.props.accountIds.skip(this.props.perWindow * newIndex).size === 0) {
|
||||
newIndex = 0;
|
||||
}
|
||||
|
||||
this.setState({ index: newIndex });
|
||||
},
|
||||
|
||||
render () {
|
||||
const { accountIds, perWindow } = this.props;
|
||||
|
||||
if (!accountIds || accountIds.size === 0) {
|
||||
return <div />;
|
||||
}
|
||||
|
||||
let nextLink = '';
|
||||
|
||||
if (accountIds.size > perWindow) {
|
||||
nextLink = <a href='#' style={nextStyle} onClick={this.handleNextClick}><FormattedMessage id='suggestions_box.refresh' defaultMessage='Refresh' /></a>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={outerStyle}>
|
||||
<strong style={headerStyle}>
|
||||
<FormattedMessage id='suggestions_box.who_to_follow' defaultMessage='Who to follow' /> {nextLink}
|
||||
</strong>
|
||||
|
||||
{accountIds.skip(perWindow * this.state.index).take(perWindow).map(accountId => <AccountContainer key={accountId} id={accountId} withNote={false} />)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
export default SuggestionsBox;
|
|
@ -1,8 +0,0 @@
|
|||
import { connect } from 'react-redux';
|
||||
import SuggestionsBox from '../components/suggestions_box';
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
accountIds: state.getIn(['user_lists', 'suggestions'])
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps)(SuggestionsBox);
|
|
@ -3,9 +3,7 @@ import ComposeFormContainer from './containers/compose_form_container';
|
|||
import UploadFormContainer from './containers/upload_form_container';
|
||||
import NavigationContainer from './containers/navigation_container';
|
||||
import PureRenderMixin from 'react-addons-pure-render-mixin';
|
||||
import SuggestionsContainer from './containers/suggestions_container';
|
||||
import SearchContainer from './containers/search_container';
|
||||
import { fetchSuggestions } from '../../actions/suggestions';
|
||||
import { connect } from 'react-redux';
|
||||
import { mountCompose, unmountCompose } from '../../actions/compose';
|
||||
|
||||
|
@ -19,7 +17,6 @@ const Compose = React.createClass({
|
|||
|
||||
componentDidMount () {
|
||||
this.props.dispatch(mountCompose());
|
||||
this.props.dispatch(fetchSuggestions());
|
||||
},
|
||||
|
||||
componentWillUnmount () {
|
||||
|
@ -29,14 +26,10 @@ const Compose = React.createClass({
|
|||
render () {
|
||||
return (
|
||||
<Drawer>
|
||||
<div style={{ flex: '1 1 auto' }}>
|
||||
<SearchContainer />
|
||||
<NavigationContainer />
|
||||
<ComposeFormContainer />
|
||||
<UploadFormContainer />
|
||||
</div>
|
||||
|
||||
<SuggestionsContainer />
|
||||
<SearchContainer />
|
||||
<NavigationContainer />
|
||||
<ComposeFormContainer />
|
||||
<UploadFormContainer />
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue