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 --- front/odiparpack/app/components/Chat/ChatHeader.js | 122 +++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 front/odiparpack/app/components/Chat/ChatHeader.js (limited to 'front/odiparpack/app/components/Chat/ChatHeader.js') diff --git a/front/odiparpack/app/components/Chat/ChatHeader.js b/front/odiparpack/app/components/Chat/ChatHeader.js new file mode 100644 index 0000000..b3456e9 --- /dev/null +++ b/front/odiparpack/app/components/Chat/ChatHeader.js @@ -0,0 +1,122 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import { withStyles } from '@material-ui/core/styles'; +import classNames from 'classnames'; +import MoreVertIcon from '@material-ui/icons/MoreVert'; +import ArrowBack from '@material-ui/icons/ArrowBack'; +import { Typography, AppBar, Menu, MenuItem, Avatar, IconButton, Toolbar } from '@material-ui/core'; +import styles from '../Contact/contact-jss'; + + +const optionsOpt = [ + 'Delete Conversation', + 'Option 1', + 'Option 2', + 'Option 3', +]; + +const ITEM_HEIGHT = 48; + +class ChatHeader extends React.Component { + state = { + anchorElOpt: null, + }; + + handleClickOpt = event => { + this.setState({ anchorElOpt: event.currentTarget }); + }; + + handleCloseOpt = () => { + this.setState({ anchorElOpt: null }); + }; + + handleRemove = (person) => { + this.props.remove(person); + } + + render() { + const { + classes, + chatSelected, + dataContact, + showMobileDetail, + hideDetail, + } = this.props; + const { anchorElOpt } = this.state; + return ( + + + {showMobileDetail && ( + hideDetail()} + className={classes.navIconHide} + > + + + )} + + + {dataContact.getIn([chatSelected, 'name'])} + + + {' '} +Online + + + + + + + + {optionsOpt.map(option => { + if (option === 'Delete Conversation') { + return ( + + {option} + + ); + } + return ( + + {option} + + ); + })} + + + ); + } +} + +ChatHeader.propTypes = { + classes: PropTypes.object.isRequired, + dataContact: PropTypes.object.isRequired, + showMobileDetail: PropTypes.bool.isRequired, + hideDetail: PropTypes.func.isRequired, + remove: PropTypes.func.isRequired, + chatSelected: PropTypes.number.isRequired, +}; + +export default withStyles(styles)(ChatHeader); -- cgit v1.2.3