|
@@ -4,8 +4,6 @@ import MicNoneIcon from '@mui/icons-material/MicNone';
|
|
|
import VideocamIcon from '@mui/icons-material/Videocam';
|
|
|
import AttachFileIcon from '@mui/icons-material/AttachFile';
|
|
|
import SentimentSatisfiedAltIcon from '@mui/icons-material/SentimentSatisfiedAlt';
|
|
|
-import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
|
|
|
-import Avatar from '@mui/material/Avatar';
|
|
|
import CloseIcon from '@mui/icons-material/Close';
|
|
|
import { useReactMediaRecorder } from "react-media-recorder";
|
|
|
import { useState } from "react";
|
|
@@ -24,29 +22,18 @@ import { typingChat } from "../../../../../api-data";
|
|
|
|
|
|
const useStyles = makeStyles({
|
|
|
container: {
|
|
|
- display: "flex",
|
|
|
- justifyContent: "space-between",
|
|
|
- alignContent: 'flex-end',
|
|
|
- alignItems:'flex-end',
|
|
|
- width: 700,
|
|
|
+ width: 634,
|
|
|
+ height:'6vh',
|
|
|
position: 'fixed',
|
|
|
- bottom: 20,
|
|
|
- paddingTop:10,
|
|
|
- },
|
|
|
- inputContainer: {
|
|
|
- position:'relative',
|
|
|
- minWidth: 634,
|
|
|
- maxWidth: 634,
|
|
|
- maxHeight:56,
|
|
|
+ bottom: '2vh',
|
|
|
+ borderRadius: 8,
|
|
|
+ padding: 10,
|
|
|
display: 'flex',
|
|
|
flexWrap: 'nowrap',
|
|
|
alignContent: 'center',
|
|
|
alignItems: 'center',
|
|
|
color: '#6b6b6b',
|
|
|
- backgroundColor: '#ffffff',
|
|
|
- borderRadius: 8,
|
|
|
- padding: 10,
|
|
|
- marginRight: 15,
|
|
|
+ backgroundColor: '#ffffff',
|
|
|
},
|
|
|
textarea: {
|
|
|
minWidth: 550,
|
|
@@ -67,13 +54,21 @@ const useStyles = makeStyles({
|
|
|
attachIcon: {
|
|
|
transform:'rotate(30deg)',
|
|
|
},
|
|
|
+ borderTop: {
|
|
|
+ position: 'absolute',
|
|
|
+ left: 0,
|
|
|
+ top: '-2vh',
|
|
|
+ width: '100%',
|
|
|
+ height: 1,
|
|
|
+ background:'#ffffff',
|
|
|
+ },
|
|
|
filesMenu: {
|
|
|
background: '#fdfdfd',
|
|
|
position: 'absolute',
|
|
|
width: 300,
|
|
|
maxWidth: '100%',
|
|
|
left: '61%',
|
|
|
- bottom:90,
|
|
|
+ bottom:'10vh',
|
|
|
zIndex: 10,
|
|
|
visibility: 'visible',
|
|
|
borderRadius: 10,
|
|
@@ -84,7 +79,8 @@ const useStyles = makeStyles({
|
|
|
position: 'absolute',
|
|
|
width: 350,
|
|
|
height:350,
|
|
|
- bottom:90,
|
|
|
+ left: '44%',
|
|
|
+ bottom:'10vh',
|
|
|
zIndex: 10,
|
|
|
visibility: 'visible',
|
|
|
borderRadius: 10,
|
|
@@ -104,12 +100,6 @@ const useStyles = makeStyles({
|
|
|
color: '#ffffff',
|
|
|
}
|
|
|
},
|
|
|
- avatar: {
|
|
|
- '&:hover': {
|
|
|
- backgroundColor: 'rgb(41, 139, 231)',
|
|
|
- color: '#ffffff',
|
|
|
- }
|
|
|
- },
|
|
|
avatarCamera: {
|
|
|
position: 'absolute',
|
|
|
left: -72,
|
|
@@ -123,38 +113,21 @@ const useStyles = makeStyles({
|
|
|
border:'solid 14px rgb(41, 139, 231)',
|
|
|
color: '#ffffff',
|
|
|
}
|
|
|
- },
|
|
|
- avatarArrowWrapper: {
|
|
|
- position:'absolute',
|
|
|
- right: -140,
|
|
|
- bottom: 200,
|
|
|
- width: 56,
|
|
|
- },
|
|
|
- avatarArrow: {
|
|
|
- cursor:'pointer',
|
|
|
- '&:hover': {
|
|
|
- backgroundColor: 'rgb(41, 139, 231)',
|
|
|
- color: '#ffffff',
|
|
|
- }
|
|
|
},
|
|
|
- listSeenIcon: {
|
|
|
+ avatarRight: {
|
|
|
position: 'absolute',
|
|
|
- top: -8,
|
|
|
- left: 16,
|
|
|
- borderRadius: '50%',
|
|
|
- color: '#ffffff',
|
|
|
- border: 'none',
|
|
|
- height: 24,
|
|
|
- width: 24,
|
|
|
- textAlign: 'center',
|
|
|
+ right: -72,
|
|
|
+ bottom:-1,
|
|
|
display: 'flex',
|
|
|
- alignItems: 'center',
|
|
|
- justifyContent: 'center',
|
|
|
- alignContent: 'center',
|
|
|
- fontSize: 12,
|
|
|
+ borderRadius: '50%',
|
|
|
zIndex: 10,
|
|
|
- cursor:'pointer',
|
|
|
- },
|
|
|
+ border: 'solid 14px #ffffff',
|
|
|
+ '&:hover': {
|
|
|
+ backgroundColor: 'rgb(41, 139, 231)',
|
|
|
+ border:'solid 14px rgb(41, 139, 231)',
|
|
|
+ color: '#ffffff'
|
|
|
+ }
|
|
|
+ },
|
|
|
overlay: {
|
|
|
position: 'fixed',
|
|
|
top: 0,
|
|
@@ -167,11 +140,10 @@ const useStyles = makeStyles({
|
|
|
|
|
|
interface ISendMessage{
|
|
|
isArrow: boolean,
|
|
|
- isNew: {new:number,mute:boolean},
|
|
|
handleScrollTo:() => void
|
|
|
}
|
|
|
|
|
|
-const SendMessage = ({isArrow,isNew,handleScrollTo}:ISendMessage) => {
|
|
|
+const SendMessage = ({isArrow,handleScrollTo}:ISendMessage) => {
|
|
|
const classes = useStyles();
|
|
|
const { companionId } = useSelector(getChat)
|
|
|
const isOpen = useSelector(getIsOpen)
|
|
@@ -280,26 +252,34 @@ const SendMessage = ({isArrow,isNew,handleScrollTo}:ISendMessage) => {
|
|
|
if (isFilming) return _stopRecording()
|
|
|
_startRecording()
|
|
|
setType('filming')
|
|
|
- setIsFilming(true)
|
|
|
-
|
|
|
+ setIsFilming(true)
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
- <div className={classes.container} style={{borderTop:isArrow?'solid 1px #ffffff':'none'}} >
|
|
|
- <div className={classes.inputContainer}>
|
|
|
+ <div className={classes.container}>
|
|
|
+ {isArrow&&<div className={classes.borderTop}></div>}
|
|
|
<CloseIcon onClick={clearMessage} fontSize="small" className={classes.iconCancel}
|
|
|
sx={{width: 56, height: 56, display: file || value || status === 'stopped'
|
|
|
|| _status === 'stopped' ? 'inline-block' : 'none'}} />
|
|
|
<VideocamIcon onClick={handleFilming} className={classes.avatarCamera}
|
|
|
sx={{backgroundColor: '#ffffff', color: '#7c7c7c', width: 56, height: 56}}
|
|
|
style={{display: status !== 'idle' || _status === 'stopped' || file || value ? 'none' : 'block',
|
|
|
- animation:isFilming ? 'ripple 1.2s infinite ease-in-out': 'none'}} />
|
|
|
+ animation: isFilming ? 'ripple 1.2s infinite ease-in-out' : 'none'
|
|
|
+ }} />
|
|
|
+ <SendIcon onClick={sentMessage} className={classes.avatarRight}
|
|
|
+ sx={{backgroundColor: '#ffffff',color: 'rgb(41, 139, 231)', width: 56, height: 56}}
|
|
|
+ style={{display: value || file || status === 'stopped' || _status === 'stopped' ? 'block':'none' }}/>
|
|
|
+ <MicNoneIcon onClick={handleRecording} className={classes.avatarRight}
|
|
|
+ sx={{backgroundColor: isRecording ? 'rgb(41, 139, 231)' : '#ffffff',
|
|
|
+ color: isRecording ? '#ffffff' : '#6b6b6b', width: 56, height: 56}}
|
|
|
+ style={{display: !value && !file && status !== 'stopped' && _status === 'idle' ? 'block' : 'none',
|
|
|
+ animation:isRecording ? 'ripple 1.2s infinite ease-in-out': 'none'}}/>
|
|
|
<SentimentSatisfiedAltIcon onClick={handleOpenEmoji}
|
|
|
fontSize='medium' sx={{color: isOpenEmoji ? 'rgb(41, 139, 231)' : '#6b6b6b', cursor: 'pointer',
|
|
|
'&:hover': { color: 'rgb(41, 139, 231)'}}}/>
|
|
|
<div onClick={handleCloseEmoji} className={classes.overlay} id='overlay'
|
|
|
style={{ display: isOpenEmoji ? 'block':'none'}}>
|
|
|
- <div className={classes.emoji} style={{left: isOpen&&isOpen !== 'menu'?'31%':'44%'}}>
|
|
|
+ <div className={classes.emoji} style={{left: isOpen&&isOpen !== 'menu'?'33.5%':'46%'}}>
|
|
|
<NotDone name='Emoji Bar'/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -315,31 +295,10 @@ const SendMessage = ({isArrow,isNew,handleScrollTo}:ISendMessage) => {
|
|
|
}} />
|
|
|
<div onClick={handleCloseFileMenu} className={classes.overlay} id='overlay'
|
|
|
style={{ display: isOpenMenu ? 'block':'none'}}>
|
|
|
- <div className={classes.filesMenu} style={{left: isOpen&&isOpen !== 'menu'?'48%':'61%'}}>
|
|
|
+ <div className={classes.filesMenu} style={{left: isOpen&&isOpen !== 'menu'?'51%':'63.5%'}}>
|
|
|
<FilesMenu setFile={setFile} setValue={setValue} setIsOpenMenu={setIsOpenMenu} setType={setType}/>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div className={classes.avatarArrowWrapper} style={{display: isArrow ? 'block' : 'none'}}>
|
|
|
- <button onClick={handleScrollTo} style={{display: isNew.new ? 'block' : 'none',
|
|
|
- background: isNew.mute ? '#a7aaa7' : '#0ac40a'}}
|
|
|
- className={classes.listSeenIcon}>{isNew.new}</button>
|
|
|
- <Avatar onClick={handleScrollTo} className={classes.avatarArrow}
|
|
|
- sx={{backgroundColor: '#ffffff', width: 56, height: 56,color: '#6b6b6b'}}>
|
|
|
- <ArrowDownwardIcon fontSize="medium" />
|
|
|
- </Avatar>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- {value || file || status === 'stopped' || _status === 'stopped' ?
|
|
|
- <Avatar onClick={sentMessage} className={classes.avatar} sx={{
|
|
|
- backgroundColor: '#ffffff',color: 'rgb(41, 139, 231)', width: 56, height: 56}}>
|
|
|
- <SendIcon fontSize="medium" />
|
|
|
- </Avatar> : null}
|
|
|
- {!value && !file && status !== 'stopped' && _status === 'idle' ? <Avatar onClick={handleRecording}
|
|
|
- className={classes.avatar} style={{animation:isRecording ? 'ripple 1.2s infinite ease-in-out': 'none'}}
|
|
|
- sx={{backgroundColor: isRecording ? 'rgb(41, 139, 231)' : '#ffffff',
|
|
|
- color: isRecording ? '#ffffff' : '#6b6b6b', width: 56, height: 56}}>
|
|
|
- <MicNoneIcon fontSize="medium" />
|
|
|
- </Avatar>:null}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
)
|
|
|
}
|