mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
add ui
This commit is contained in:
1 parent
777a4bc927
commit
9c45527522
396 files changed
+13772
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
|
||||
export default function MessageComponent(props) {
|
||||
const {
|
||||
faceUrl,
|
||||
isSelf,
|
||||
className,
|
||||
children,
|
||||
...rest
|
||||
} = props;
|
||||
const cn = classNames(className, 'messagepad__message', {
|
||||
'side--self': isSelf,
|
||||
'side--other': !isSelf,
|
||||
});
|
||||
return (
|
||||
<li {...rest} className={cn}>
|
||||
<div className="messagepad__message__avatar">
|
||||
<img src={faceUrl} alt="avatar" width="50" height="50" className="medium user-profile-avatar" />
|
||||
</div>
|
||||
<div className="messagepad__message__body">
|
||||
{children}
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
MessageComponent.propTypes = {
|
||||
isSelf: PropTypes.bool,
|
||||
faceUrl: PropTypes.string.isRequired,
|
||||
className: PropTypes.string,
|
||||
children: PropTypes.node,
|
||||
};
|
||||
Reference in new issue
Block a user