MyCrypto/common/containers/TabSection/NotificationRow.tsx
James Prado 6f7e3c27e2 Fix regressions introduced in #241 (#247)
* Fix location query

* Remove unnecessary polyfill

* Fix tslint error & update history types

* Parse search str using Node Query String

* Revert "Parse search str using Node Query String"

This reverts commit 0a482dabf29c3fbcbfd3112b974d6b98c14dca2e.

* fix formatting

* Add query-string

* Rename App container to TabSection & pass it location prop

* Add react-router withRouter HOC to NavigationLink

* various adjustments/finalizations

* Add location to props interface
2017-10-03 21:13:49 -07:00

37 lines
944 B
TypeScript

import { Notification } from 'actions/notifications';
import classnames from 'classnames';
import React, { Component } from 'react';
import './Notifications.scss';
interface Props {
notification: Notification;
onClose(n: Notification): void;
}
export default class NotificationRow extends Component<Props, {}> {
public render() {
const { msg, level } = this.props.notification;
const notifClass = classnames({
Notification: true,
alert: true,
[`alert-${level}`]: !!level
});
return (
<div className={notifClass} role="alert" aria-live="assertive">
<span className="sr-only">{level}</span>
<div className="Notification-message">{msg}</div>
<button
className="Notification-close"
aria-label="dismiss"
onClick={this.onClose}
/>
</div>
);
}
public onClose = () => {
this.props.onClose(this.props.notification);
};
}