mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Updated tests and Drawer component
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user