|
@@ -2,9 +2,11 @@ import { makeStyles } from "@material-ui/core/styles";
|
|
|
import SendIcon from '@mui/icons-material/Send';
|
|
|
import MicNoneIcon from '@mui/icons-material/MicNone';
|
|
|
import VideocamIcon from '@mui/icons-material/Videocam';
|
|
|
+import PauseIcon from '@mui/icons-material/Pause';
|
|
|
import AttachFileIcon from '@mui/icons-material/AttachFile';
|
|
|
import SentimentSatisfiedAltIcon from '@mui/icons-material/SentimentSatisfiedAlt';
|
|
|
import CloseIcon from '@mui/icons-material/Close';
|
|
|
+import Avatar from '@mui/material/Avatar';
|
|
|
import Picker from 'emoji-picker-react';
|
|
|
import { useReactMediaRecorder } from "react-media-recorder";
|
|
|
import { useState } from "react";
|
|
@@ -120,7 +122,29 @@ const useStyles = makeStyles({
|
|
|
border:'solid 14px rgb(41, 139, 231)',
|
|
|
color: '#ffffff'
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
+ pauseLeft: {
|
|
|
+ position: 'absolute',
|
|
|
+ left: -72,
|
|
|
+ bottom:-1,
|
|
|
+ zIndex: 10,
|
|
|
+ },
|
|
|
+ pauseRight: {
|
|
|
+ position: 'absolute',
|
|
|
+ right: -72,
|
|
|
+ bottom:-1,
|
|
|
+ zIndex: 10,
|
|
|
+ },
|
|
|
+ avatarPause: {
|
|
|
+ backgroundColor: '#ffffff',
|
|
|
+ cursor: 'pointer',
|
|
|
+ animation: `$shake 1s`,
|
|
|
+ animationIterationCount:'infinite',
|
|
|
+ '&:hover': {
|
|
|
+ backgroundColor: 'rgb(41, 139, 231)',
|
|
|
+ color: '#ffffff',
|
|
|
+ }
|
|
|
+ },
|
|
|
overlay: {
|
|
|
position: 'fixed',
|
|
|
top: 0,
|
|
@@ -131,25 +155,25 @@ const useStyles = makeStyles({
|
|
|
},
|
|
|
ringContainerLeft: {
|
|
|
position: 'absolute',
|
|
|
- left: 10,
|
|
|
- top: -40,
|
|
|
+ left: -25,
|
|
|
+ top: -30,
|
|
|
zIndex: 10,
|
|
|
},
|
|
|
ringContainerRight: {
|
|
|
position: 'absolute',
|
|
|
- right: 10,
|
|
|
- top: -40,
|
|
|
+ right: -25,
|
|
|
+ top: -30,
|
|
|
zIndex: 10,
|
|
|
},
|
|
|
circle: {
|
|
|
width: 15,
|
|
|
height: 15,
|
|
|
- backgroundColor: '#ff0505',
|
|
|
+ backgroundColor: 'rgb(255, 4, 4)',
|
|
|
borderRadius: '50%',
|
|
|
position: 'relative'
|
|
|
},
|
|
|
ringRing: {
|
|
|
- border: '3px solid #ff0505',
|
|
|
+ border: '3px solid rgb(255, 4, 4)',
|
|
|
borderRadius: '50%',
|
|
|
height: 25,
|
|
|
width: 25,
|
|
@@ -165,6 +189,19 @@ const useStyles = makeStyles({
|
|
|
'50%': { opacity: 1},
|
|
|
'100%': {transform: 'scale(1.2, 1.2)', opacity: 0},
|
|
|
},
|
|
|
+ '@keyframes shake': {
|
|
|
+ '0%': { transform: 'translate(0.5px, 0.5px) rotate(0deg)'},
|
|
|
+ '10%': { transform: 'translate(-0.5px, -1px) rotate(-1deg)'},
|
|
|
+ '20%': { transform: 'translate(-1.5px, 0px) rotate(1deg)'},
|
|
|
+ '30%': { transform: 'translate(1.5px, 1px) rotate(0deg)'},
|
|
|
+ '40%': { transform: 'translate(0.5px, -0.5px) rotate(1deg)'},
|
|
|
+ '50%': { transform: 'translate(-0.5px, 1px) rotate(-1deg)'},
|
|
|
+ '60%': { transform: 'translate(-1.5px, 0.5px) rotate(0deg)'},
|
|
|
+ '70%': { transform: 'translate(1.5px, 0.5px) rotate(-1deg)'},
|
|
|
+ '80%': { transform: 'translate(-0.5px, -0.5px) rotate(1deg)'},
|
|
|
+ '90%': { transform: 'translate(0.5px, 1px) rotate(0deg)'},
|
|
|
+ '100%': { transform: 'translate(0.5px, -1px) rotate(-1deg)'},
|
|
|
+ },
|
|
|
});
|
|
|
|
|
|
interface ISendMessage{
|
|
@@ -287,32 +324,44 @@ const SendMessage = ({isArrow }:ISendMessage) => {
|
|
|
return (
|
|
|
<div className={classes.container}>
|
|
|
{isArrow && <div className={classes.borderTop}></div>}
|
|
|
- {isFilming && _status !== 'stopped' &&
|
|
|
+ {isFilming && _status !== 'stopped' &&
|
|
|
+ <>
|
|
|
+ <div className={classes.pauseLeft}>
|
|
|
+ <Avatar onClick={handleFilming } className={classes.avatarPause}
|
|
|
+ sx={{backgroundColor: '#ffffff',color:'#6b6b6b',width: 56, height: 56}}>
|
|
|
+ <PauseIcon fontSize="large"/>
|
|
|
+ </Avatar>
|
|
|
+ </div>
|
|
|
<div className={classes.ringContainerLeft}>
|
|
|
- <div className={classes.ringRing}></div>
|
|
|
- <div className={classes.circle}></div>
|
|
|
- </div>}
|
|
|
- {isRecording && status !== 'stopped' &&
|
|
|
- <div className={classes.ringContainerRight}>
|
|
|
- <div className={classes.ringRing}></div>
|
|
|
- <div className={classes.circle}></div>
|
|
|
- </div>}
|
|
|
+ <div className={classes.ringRing}></div>
|
|
|
+ <div className={classes.circle}></div>
|
|
|
+ </div>
|
|
|
+ </>}
|
|
|
+ {isRecording && status !== 'stopped' &&
|
|
|
+ <>
|
|
|
+ <div className={classes.pauseRight}>
|
|
|
+ <Avatar onClick={handleRecording} className={classes.avatarPause}
|
|
|
+ sx={{backgroundColor: '#ffffff',color:'#6b6b6b',width: 56, height: 56}}>
|
|
|
+ <PauseIcon fontSize="large"/>
|
|
|
+ </Avatar>
|
|
|
+ </div>
|
|
|
+ <div className={classes.ringContainerRight}>
|
|
|
+ <div className={classes.ringRing}></div>
|
|
|
+ <div className={classes.circle}></div>
|
|
|
+ </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'
|
|
|
- }} />
|
|
|
+ sx={{backgroundColor: '#ffffff', color: '#6b6b6b', width: 56, height: 56}}
|
|
|
+ style={{display: status !== 'idle' || _status === 'stopped' || file || value || isFilming ? 'none' : 'block'}} />
|
|
|
<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'}}/>
|
|
|
+ sx={{backgroundColor:'#ffffff',color: '#6b6b6b', width: 56, height: 56}}
|
|
|
+ style={{display: !value && !file && status !== 'stopped' && _status === 'idle'&&!isRecording ? 'block' : 'none'}}/>
|
|
|
<SentimentSatisfiedAltIcon onClick={handleOpenEmoji}
|
|
|
fontSize='medium' sx={{color: isOpenEmoji ? 'rgb(41, 139, 231)' : '#6b6b6b', cursor: 'pointer',
|
|
|
pointerEvents: file || status !== 'idle' || _status !== 'idle' ? 'none' : "auto",
|