Skip to content

Commit

Permalink
fix: ∆
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLantz committed Jan 11, 2017
1 parent ec1e1ee commit 4ba9712
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class AlertsComponent {

ReactDOM.render(
<IntlProvider locale={locale}>
<AlertList data={config} />
<AlertList />
</IntlProvider>,
document.getElementById(config.elementId)
);
Expand Down
12 changes: 8 additions & 4 deletions src/js/AlertList.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class AlertList extends Component {
super(props);

this.state = {
alertList : [],

alertList : [],
dismissAlert : ''
};

Expand All @@ -31,6 +32,11 @@ class AlertList extends Component {
}


// componentWillUnmount() {
// this.setState({alertList:this.state.alertList.filter((e, index, a) => a[index] !== a[this.state.currentIndex])})
// }


render () {

const { alertList } = this.state;
Expand All @@ -49,11 +55,9 @@ export default AlertList;

function _handleClose (currentIndex) {

const { alertList } = this.state;

this.setState({
dismissAlert : 'close-title-animation',
alertList : alertList.filter((e, index, a) => a[index] !== a[currentIndex])
alertList:this.state.alertList.filter((e, index, a) => a[index] !== a[currentIndex])
});

}
Expand Down
7 changes: 4 additions & 3 deletions src/scss/component-specific.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import './variables';

.pe-alert {
position:relative;
margin-top: 30px;
list-style:none;
animation-name: openAlert;
Expand Down Expand Up @@ -32,7 +33,7 @@ svg {
}

@keyframes openAlert {
0% { top: 200px; }
0% { top: -200px; }
100% { top: 0px; }
}

Expand All @@ -57,10 +58,10 @@ svg {

.close-title-animation {
animation-name: closeAlert;
animation-duration: .2s;
animation-duration: 3.2s;
}

@keyframes closeAlert {
0% {}
100% { left: -510px; }
100% { left: 1510px; }
}

0 comments on commit 4ba9712

Please sign in to comment.