Updated tests and Drawer component

This commit is contained in:
Belen Curcio
2017-12-04 00:37:41 -03:00
parent 67c81c0168
commit c53fe4b197
5 changed files with 29 additions and 17 deletions
@@ -138,7 +138,7 @@ class UserDetail extends React.Component {
return (
<ClickOutside onClickOutside={hideUserDetail}>
<Drawer onClose={hideUserDetail}>
<Drawer className="talk-admin-user-detail-drawer" onClose={hideUserDetail}>
<h3 className={cn(styles.username, 'talk-admin-user-detail-username')}>
{user.username}
</h3>
@@ -56,13 +56,13 @@ class Comment extends React.Component {
<div className={styles.container}>
<div className={styles.itemHeader}>
<div className={styles.author}>
{
(
<span className={styles.username} onClick={this.viewUserDetail}>
{comment.user.username}
</span>
)
}
<span
className={cn(styles.username, 'talk-admin-moderate-comment-username')}
onClick={this.viewUserDetail}>
{comment.user.username}
</span>
<span className={styles.created}>
{timeago(comment.created_at)}
</span>
+6 -3
View File
@@ -1,10 +1,11 @@
import React from 'react';
import cn from 'classnames';
import PropTypes from 'prop-types';
import styles from './Drawer.css';
const Drawer = ({children, onClose}) => {
const Drawer = ({children, onClose, className = ''}) => {
return (
<div className={styles.drawer}>
<div className={cn(styles.drawer, className)}>
<div className={styles.closeButton} onClick={onClose}>×</div>
<div className={styles.content}>
{children}
@@ -15,7 +16,9 @@ const Drawer = ({children, onClose}) => {
Drawer.propTypes = {
active: PropTypes.bool,
onClose: PropTypes.func.isRequired
onClose: PropTypes.func.isRequired,
children: PropTypes.node,
className: PropTypes.string,
};
export default Drawer;