Ivan - Improve last events animations [skip ci]
This commit is contained in:
parent
8f02a08018
commit
dcb04f7927
|
@ -68,7 +68,7 @@
|
||||||
"react-document-title": "^1.0.2",
|
"react-document-title": "^1.0.2",
|
||||||
"react-dom": "^15.0.1",
|
"react-dom": "^15.0.1",
|
||||||
"react-google-recaptcha": "^0.5.2",
|
"react-google-recaptcha": "^0.5.2",
|
||||||
"react-motion": "^0.4.4",
|
"react-motion": "^0.4.7",
|
||||||
"react-redux": "^4.4.5",
|
"react-redux": "^4.4.5",
|
||||||
"react-router": "^2.4.0",
|
"react-router": "^2.4.0",
|
||||||
"react-router-redux": "^4.0.5",
|
"react-router-redux": "^4.0.5",
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import _ from 'lodash';
|
||||||
|
import {TransitionMotion, spring} from 'react-motion';
|
||||||
|
|
||||||
import API from 'lib-app/api-call';
|
import API from 'lib-app/api-call';
|
||||||
import i18n from 'lib-app/i18n';
|
import i18n from 'lib-app/i18n';
|
||||||
|
@ -64,12 +66,30 @@ class AdminPanelActivity extends React.Component {
|
||||||
renderList() {
|
renderList() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{this.state.activities.map(this.renderRow.bind(this))}
|
<TransitionMotion styles={this.getStyles()} willEnter={this.getEnterStyle.bind(this)}>
|
||||||
|
{this.renderActivityList.bind(this)}
|
||||||
|
</TransitionMotion>
|
||||||
{(!this.state.limit) ? this.renderButton() : null}
|
{(!this.state.limit) ? this.renderButton() : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderActivityList(styles) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{styles.map(this.renderAnimatedItem.bind(this))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderAnimatedItem(config, index) {
|
||||||
|
return (
|
||||||
|
<div style={config.style} key={config.key}>
|
||||||
|
{this.renderRow(config.data, index)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
renderButton() {
|
renderButton() {
|
||||||
return (
|
return (
|
||||||
<SubmitButton type="secondary" onClick={this.retrieveNextPage.bind(this)}>
|
<SubmitButton type="secondary" onClick={this.retrieveNextPage.bind(this)}>
|
||||||
|
@ -84,6 +104,21 @@ class AdminPanelActivity extends React.Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getStyles() {
|
||||||
|
return this.state.activities.map((item, index) => ({
|
||||||
|
key: index + '',
|
||||||
|
data: item,
|
||||||
|
style: {marginTop: spring(0), opacity: spring(1)}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
getEnterStyle() {
|
||||||
|
return {
|
||||||
|
marginTop: -20,
|
||||||
|
opacity: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
onMenuItemClick(index) {
|
onMenuItemClick(index) {
|
||||||
this.setState({
|
this.setState({
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|
Loading…
Reference in New Issue