From e13e630cd6e4fc0b1ff92098a28a770794c7bb9a Mon Sep 17 00:00:00 2001 From: gabrhr <73925454+gabrhr@users.noreply.github.com> Date: Wed, 20 Apr 2022 10:19:29 -0500 Subject: =?UTF-8?q?A=C3=B1adir=20plantilla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Base para front --- .../app/components/SocialMedia/Comment.js | 135 +++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 front/odiparpack/app/components/SocialMedia/Comment.js (limited to 'front/odiparpack/app/components/SocialMedia/Comment.js') diff --git a/front/odiparpack/app/components/SocialMedia/Comment.js b/front/odiparpack/app/components/SocialMedia/Comment.js new file mode 100644 index 0000000..9ead6e7 --- /dev/null +++ b/front/odiparpack/app/components/SocialMedia/Comment.js @@ -0,0 +1,135 @@ +import React, { Fragment } from 'react'; +import PropTypes from 'prop-types'; +import classNames from 'classnames'; +import Type from 'ba-styles/Typography.scss'; +import { withStyles } from '@material-ui/core/styles'; +import Send from '@material-ui/icons/Send'; +import CommentIcon from '@material-ui/icons/Comment'; +import CloseIcon from '@material-ui/icons/Close'; +import dummy from 'ba-api/dummyContents'; +import { + Typography, + List, + ListItem, + Avatar, + Input, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + IconButton, + Fab, + Slide, + Divider, + withMobileDialog, +} from '@material-ui/core'; +import styles from './jss/socialMedia-jss'; + +const Transition = React.forwardRef(function Transition(props, ref) { // eslint-disable-line + return ; +}); + +class Comment extends React.Component { + state = { + comment: '' + }; + + handleChange = event => { + this.setState({ comment: event.target.value }); + }; + + handleSubmit = comment => { + this.props.submitComment(comment); + this.setState({ comment: '' }); + } + + render() { + const { + open, + handleClose, + classes, + dataComment, + fullScreen + } = this.props; + const { comment } = this.state; + const getItem = dataArray => dataArray.map(data => ( + + +
+
+ +
+ {data.get('from')} + {data.get('date')} +
+
+ {data.get('message')} +
+
+ +
+ )); + + return ( +
+ + + + {' '} + {dataComment !== undefined && dataComment.size} +  Comment + {dataComment !== undefined && dataComment.size > 1 ? 's' : ''} + + + + + + + {dataComment !== undefined && getItem(dataComment)} + + + +
+ + + this.handleSubmit(comment)} color="secondary" aria-label="send" className={classes.button}> + + +
+
+
+
+ ); + } +} + +Comment.propTypes = { + open: PropTypes.bool.isRequired, + handleClose: PropTypes.func.isRequired, + submitComment: PropTypes.func.isRequired, + classes: PropTypes.object.isRequired, + dataComment: PropTypes.object, + fullScreen: PropTypes.bool.isRequired, +}; + +Comment.defaultProps = { + dataComment: undefined +}; + +const CommentResponsive = withMobileDialog()(Comment); +export default withStyles(styles)(CommentResponsive); -- cgit v1.2.3