@ -1,26 +1,29 @@
import React , { Component } from 'react' ;
import React , { Component } from "react" ;
import Message from './Message' ;
import Message from "./Message" ;
import ChatInputs from './Input' ;
import ChatInputs from "./Input" ;
import Keyboard from './Keyboard' ;
import Keyboard from "./Keyboard" ;
import { RecordState } from 'audio-react-recorder' ;
import { RecordState } from "audio-react-recorder" ;
import ReactPlayer from 'react-player' ;
import ReactPlayer from "react-player" ;
import ReactAudioPlayer from 'react-audio-player' ;
import ReactAudioPlayer from "react-audio-player" ;
import { ToastContainer } from 'react-toastify' ;
import { ToastContainer } from "react-toastify" ;
import { list , send , sendKeys } from '../../../Redux/actions/message' ;
import { list , send , sendKeys } from "../../../Redux/actions/message" ;
import { info , bio } from '../../../Redux/actions/chat' ;
import { info , bio } from "../../../Redux/actions/chat" ;
import { connect } from 'react-redux' ;
import { connect } from "react-redux" ;
import Emoji from './Emoji/index' ;
import Emoji from "./Emoji/index" ;
import './index.scss' ;
import "./index.scss" ;
class List extends Component {
class List extends Component {
constructor ( props ) {
constructor ( props ) {
super ( props ) ;
super ( props ) ;
this . state = {
this . state = {
emoji : false ,
emoji : false ,
counter : 1 ,
counter : 1 ,
id : window . innerWidth < 1000 ? window . location . href . split ( '/' ) . pop ( ) * 1 : this . props . id ,
id :
window . innerWidth < 1000
? window . location . href . split ( "/" ) . pop ( ) * 1
: this . props . id ,
data : { } ,
data : { } ,
message : '' ,
message : "" ,
voice : null ,
voice : null ,
file : null ,
file : null ,
image : null ,
image : null ,
@ -30,15 +33,15 @@ class List extends Component {
} ;
} ;
}
}
addcounter ( type ) {
addcounter ( type ) {
if ( type === 'parent' ) {
if ( type === "parent" ) {
if ( localStorage . getItem ( 'tapType' ) === 'nothing' ) {
if ( localStorage . getItem ( "tapType" ) === "nothing" ) {
localStorage . removeItem ( 'tapType' ) ;
localStorage . removeItem ( "tapType" ) ;
return ;
return ;
} else {
} else {
this . setState ( { counter : this . state . counter + 1 } ) ;
this . setState ( { counter : this . state . counter + 1 } ) ;
}
}
} else {
} else {
localStorage . setItem ( 'tapType' , 'nothing' ) ;
localStorage . setItem ( "tapType" , "nothing" ) ;
return ;
return ;
}
}
}
}
@ -69,67 +72,64 @@ class List extends Component {
} ) ;
} ) ;
} ;
} ;
typeText = ( type , val ) => {
typeText = ( type , val ) => {
if ( type === 'text' ) {
if ( type === "text" ) {
this . setState ( {
this . setState ( {
message : val ,
message : val ,
} ) ;
} ) ;
}
} else {
else {
this . setState ( ( prevState ) => ( {
this . setState ( prevState => ( {
message : prevState . message + val ,
message : prevState . message + val ,
} ) ) ;
} ) ) ;
}
}
} ;
} ;
addFile = async ( e ) => {
addFile = async ( e ) => {
if (
if (
e . target . files [ 0 ] . type === 'image/apng' ||
e . target . files [ 0 ] . type === "image/apng" ||
e . target . files [ 0 ] . type === 'image/avif' ||
e . target . files [ 0 ] . type === "image/avif" ||
e . target . files [ 0 ] . type === 'image/gif' ||
e . target . files [ 0 ] . type === "image/gif" ||
e . target . files [ 0 ] . type === 'image/jpeg' ||
e . target . files [ 0 ] . type === "image/jpeg" ||
e . target . files [ 0 ] . type === 'image/png' ||
e . target . files [ 0 ] . type === "image/png" ||
e . target . files [ 0 ] . type === 'image/svg+xml' ||
e . target . files [ 0 ] . type === "image/svg+xml" ||
e . target . files [ 0 ] . type === 'image/webp'
e . target . files [ 0 ] . type === "image/webp"
) {
) {
this . setState ( {
this . setState ( {
image : URL . createObjectURL ( e . target . files [ 0 ] ) ,
image : URL . createObjectURL ( e . target . files [ 0 ] ) ,
file : 'fill' ,
file : "fill" ,
video : null ,
video : null ,
document : null ,
document : null ,
music : null ,
music : null ,
} ) ;
} ) ;
} else if (
} else if (
e . target . files [ 0 ] . type === 'video/3gpp' ||
e . target . files [ 0 ] . type === "video/3gpp" ||
e . target . files [ 0 ] . type === 'video/mpeg' ||
e . target . files [ 0 ] . type === "video/mpeg" ||
e . target . files [ 0 ] . type === 'video/mp4' ||
e . target . files [ 0 ] . type === "video/mp4" ||
e . target . files [ 0 ] . type === 'video/ogg' ||
e . target . files [ 0 ] . type === "video/ogg" ||
e . target . files [ 0 ] . type === 'video/quicktime' ||
e . target . files [ 0 ] . type === "video/quicktime" ||
e . target . files [ 0 ] . type === 'video/webm'
e . target . files [ 0 ] . type === "video/webm"
) {
) {
this . setState ( {
this . setState ( {
image : null ,
image : null ,
file : 'fill' ,
file : "fill" ,
video : URL . createObjectURL ( e . target . files [ 0 ] ) ,
video : URL . createObjectURL ( e . target . files [ 0 ] ) ,
document : null ,
document : null ,
music : null ,
music : null ,
} ) ;
} ) ;
} else if (
} else if (
e . target . files [ 0 ] . type === 'audio/3gpp' ||
e . target . files [ 0 ] . type === "audio/3gpp" ||
e . target . files [ 0 ] . type === 'audio/aac' ||
e . target . files [ 0 ] . type === "audio/aac" ||
e . target . files [ 0 ] . type === 'audio/flac' ||
e . target . files [ 0 ] . type === "audio/flac" ||
e . target . files [ 0 ] . type === 'audio/mpeg' ||
e . target . files [ 0 ] . type === "audio/mpeg" ||
e . target . files [ 0 ] . type === 'audio/mp3' ||
e . target . files [ 0 ] . type === "audio/mp3" ||
e . target . files [ 0 ] . type === 'audio/mp4' ||
e . target . files [ 0 ] . type === "audio/mp4" ||
e . target . files [ 0 ] . type === 'audio/ogg' ||
e . target . files [ 0 ] . type === "audio/ogg" ||
e . target . files [ 0 ] . type === 'audio/wav' ||
e . target . files [ 0 ] . type === "audio/wav" ||
e . target . files [ 0 ] . type === 'audio/webm'
e . target . files [ 0 ] . type === "audio/webm"
) {
) {
this . setState ( {
this . setState ( {
image : null ,
image : null ,
file : 'fill' ,
file : "fill" ,
video : null ,
video : null ,
document : null ,
document : null ,
music : URL . createObjectURL ( e . target . files [ 0 ] ) ,
music : URL . createObjectURL ( e . target . files [ 0 ] ) ,
@ -137,10 +137,13 @@ class List extends Component {
} else {
} else {
this . setState ( {
this . setState ( {
image : null ,
image : null ,
file : 'fill' ,
file : "fill" ,
video : null ,
video : null ,
music : null ,
music : null ,
document : { data : URL . createObjectURL ( e . target . files [ 0 ] ) , name : e . target . files [ 0 ] . name } ,
document : {
data : URL . createObjectURL ( e . target . files [ 0 ] ) ,
name : e . target . files [ 0 ] . name ,
} ,
} ) ;
} ) ;
}
}
} ;
} ;
@ -157,8 +160,8 @@ class List extends Component {
messages : [
messages : [
... prevState . data . messages ,
... prevState . data . messages ,
{
{
id : 'm12' ,
id : "m12" ,
type : 'normal' ,
type : "normal" ,
text : prevState . message ,
text : prevState . message ,
voice : null ,
voice : null ,
image : null ,
image : null ,
@ -168,15 +171,15 @@ class List extends Component {
document : null ,
document : null ,
createdAt : now . toString ( ) ,
createdAt : now . toString ( ) ,
user : {
user : {
id : 'u1' ,
id : "u1" ,
name : 'علی' ,
name : "علی" ,
} ,
} ,
} ,
} ,
] ,
] ,
} ,
} ,
} ) ) ;
} ) ) ;
this . setState ( {
this . setState ( {
message : '' ,
message : "" ,
} ) ;
} ) ;
}
}
} ;
} ;
@ -189,9 +192,9 @@ class List extends Component {
messages : [
messages : [
... prevState . data . messages ,
... prevState . data . messages ,
{
{
id : 'm9' ,
id : "m9" ,
text : null ,
text : null ,
type : 'normal' ,
type : "normal" ,
voice : audioData ,
voice : audioData ,
createdAt : now . toString ( ) ,
createdAt : now . toString ( ) ,
image : null ,
image : null ,
@ -199,8 +202,8 @@ class List extends Component {
document : null ,
document : null ,
music : null ,
music : null ,
user : {
user : {
id : 'u1' ,
id : "u1" ,
name : 'علی' ,
name : "علی" ,
} ,
} ,
} ,
} ,
] ,
] ,
@ -221,8 +224,8 @@ class List extends Component {
messages : [
messages : [
... prevState . data . messages ,
... prevState . data . messages ,
{
{
id : 'm8' ,
id : "m8" ,
type : 'normal' ,
type : "normal" ,
text : prevState . message ,
text : prevState . message ,
voice : null ,
voice : null ,
createdAt : now . toString ( ) ,
createdAt : now . toString ( ) ,
@ -231,8 +234,8 @@ class List extends Component {
document : null ,
document : null ,
music : null ,
music : null ,
user : {
user : {
id : 'u1' ,
id : "u1" ,
name : 'علی' ,
name : "علی" ,
} ,
} ,
} ,
} ,
] ,
] ,
@ -241,7 +244,7 @@ class List extends Component {
this . setState ( {
this . setState ( {
file : null ,
file : null ,
image : null ,
image : null ,
message : '' ,
message : "" ,
} ) ;
} ) ;
} else if ( video !== null ) {
} else if ( video !== null ) {
this . setState ( ( prevState ) => ( {
this . setState ( ( prevState ) => ( {
@ -250,8 +253,8 @@ class List extends Component {
messages : [
messages : [
... prevState . data . messages ,
... prevState . data . messages ,
{
{
id : 'm8' ,
id : "m8" ,
type : 'normal' ,
type : "normal" ,
text : prevState . message ,
text : prevState . message ,
voice : null ,
voice : null ,
createdAt : now . toString ( ) ,
createdAt : now . toString ( ) ,
@ -260,8 +263,8 @@ class List extends Component {
document : null ,
document : null ,
music : null ,
music : null ,
user : {
user : {
id : 'u1' ,
id : "u1" ,
name : 'علی' ,
name : "علی" ,
} ,
} ,
} ,
} ,
] ,
] ,
@ -270,7 +273,7 @@ class List extends Component {
this . setState ( {
this . setState ( {
file : null ,
file : null ,
video : null ,
video : null ,
message : '' ,
message : "" ,
} ) ;
} ) ;
} else if ( music !== null ) {
} else if ( music !== null ) {
this . setState ( ( prevState ) => ( {
this . setState ( ( prevState ) => ( {
@ -279,9 +282,9 @@ class List extends Component {
messages : [
messages : [
... prevState . data . messages ,
... prevState . data . messages ,
{
{
id : 'm8' ,
id : "m8" ,
text : prevState . message ,
text : prevState . message ,
type : 'normal' ,
type : "normal" ,
voice : null ,
voice : null ,
createdAt : now . toString ( ) ,
createdAt : now . toString ( ) ,
image : null ,
image : null ,
@ -289,8 +292,8 @@ class List extends Component {
document : null ,
document : null ,
music : music ,
music : music ,
user : {
user : {
id : 'u1' ,
id : "u1" ,
name : 'علی' ,
name : "علی" ,
} ,
} ,
} ,
} ,
] ,
] ,
@ -299,7 +302,7 @@ class List extends Component {
this . setState ( {
this . setState ( {
file : null ,
file : null ,
music : null ,
music : null ,
message : '' ,
message : "" ,
} ) ;
} ) ;
} else if ( document !== null ) {
} else if ( document !== null ) {
this . setState ( ( prevState ) => ( {
this . setState ( ( prevState ) => ( {
@ -308,9 +311,9 @@ class List extends Component {
messages : [
messages : [
... prevState . data . messages ,
... prevState . data . messages ,
{
{
id : 'm8' ,
id : "m8" ,
text : prevState . message ,
text : prevState . message ,
type : 'normal' ,
type : "normal" ,
voice : null ,
voice : null ,
createdAt : now . toString ( ) ,
createdAt : now . toString ( ) ,
@ -319,8 +322,8 @@ class List extends Component {
document : document ,
document : document ,
music : null ,
music : null ,
user : {
user : {
id : 'u1' ,
id : "u1" ,
name : 'علی' ,
name : "علی" ,
} ,
} ,
} ,
} ,
] ,
] ,
@ -329,7 +332,7 @@ class List extends Component {
this . setState ( {
this . setState ( {
file : null ,
file : null ,
document : null ,
document : null ,
message : '' ,
message : "" ,
} ) ;
} ) ;
}
}
} ;
} ;
@ -338,7 +341,7 @@ class List extends Component {
this . setState ( {
this . setState ( {
file : null ,
file : null ,
document : null ,
document : null ,
message : '' ,
message : "" ,
image : null ,
image : null ,
video : null ,
video : null ,
voice : null ,
voice : null ,
@ -353,19 +356,29 @@ class List extends Component {
}
}
componentDidUpdate ( prevProps ) {
componentDidUpdate ( prevProps ) {
let chatroom = document . getElementById ( 'chatroom' ) ;
let chatroom = document . getElementById ( "chatroom" ) ;
chatroom . scrollTop = chatroom . scrollHeight + 40 ;
chatroom . scrollTop = chatroom . scrollHeight + 40 ;
if ( prevProps . id !== this . props . id ) {
if ( prevProps . id !== this . props . id ) {
this . props . info ( { id : window . innerWidth < 1000 ? window . location . href . split ( '/' ) . pop ( ) * 1 : this . props . id } ) ;
this . props . info ( {
id :
window . innerWidth < 1000
? window . location . href . split ( "/" ) . pop ( ) * 1
: this . props . id ,
} ) ;
this . props . list ( { chatId : window . innerWidth < 1000 ? window . location . href . split ( '/' ) . pop ( ) * 1 : this . props . id } ) ;
this . props . list ( {
chatId :
window . innerWidth < 1000
? window . location . href . split ( "/" ) . pop ( ) * 1
: this . props . id ,
} ) ;
}
}
}
}
randomColor ( ) {
randomColor ( ) {
let hex = Math . floor ( Math . random ( ) * 0x999999 ) ;
let hex = Math . floor ( Math . random ( ) * 0x999999 ) ;
let color = '#' + hex . toString ( 16 ) ;
let color = "#" + hex . toString ( 16 ) ;
return color ;
return color ;
}
}
@ -375,115 +388,261 @@ class List extends Component {
const last = messageList . slice ( - 1 ) [ 0 ] || { } ;
const last = messageList . slice ( - 1 ) [ 0 ] || { } ;
const userIdx = this . userIdx || { } ;
const userIdx = this . userIdx || { } ;
if ( Object . keys ( userIdx ) . length == 0 ) {
if ( Object . keys ( userIdx ) . length == 0 ) {
chatInfo . users . map ( ( e ) => ( userIdx [ e . id ] = { ... e , color : this . randomColor ( ) } ) ) ;
chatInfo . users . map (
( e ) => ( userIdx [ e . id ] = { ... e , color : this . randomColor ( ) } )
) ;
this . userIdx = userIdx ;
this . userIdx = userIdx ;
}
}
return (
return (
< div
< >
className = "chat-body d-flex flex-column nobar "
{ window . innerWidth < 1000 ? (
onClick = { ( ) => this . addcounter ( 'parent' ) }
< div
>
className = "chat-body d-flex flex-column nobar "
< div
onClick = { ( ) => this . addcounter ( "parent" ) }
className = "chat-body__content d-flex flex-column nobar"
>
id = "chatroom"
< div
style = { {
className = "chat-body__content d-flex flex-column nobar"
paddingTop : 10 ,
id = "chatroom"
overflowX : 'hidden' ,
style = { {
overflowY : this . state . file !== null ? 'hidden' : 'scroll' ,
paddingTop : 10 ,
paddingBottom : last . action === 'keyboard' ? 150 : 10 ,
overflowX : "hidden" ,
} }
overflowY : this . state . file !== null ? "hidden" : "scroll" ,
>
paddingBottom : last . action === "keyboard" ? 150 : 10 ,
{ chatInfo . users &&
} }
messageList . map ( ( message , i ) =>
>
this . state . image === null &&
{ chatInfo . users &&
this . state . music === null &&
messageList . map ( ( message , i ) =>
this . state . video === null ? (
this . state . image === null &&
< Message
this . state . music === null &&
this . state . video === null ? (
< Message
addcounter = { ( ) => this . addcounter ( ) }
isActive = { message . id == last . id }
prevUserId = { i > 0 ? messageList [ i - 1 ] . userId : 0 }
isSelf = { new Set ( [ 101 , 103 , 106 , 108 , 110 ] ) . has (
message . userId * 1
) }
key = { message . id }
file = { this . state . image }
document = { this . state . document }
message = { message }
user = {
userIdx [ message . userId ] || {
id : 0 ,
fileId : 0 ,
name : "null" ,
}
}
/ >
) : null
) }
{ this . state . image !== null ? (
< div className = "chat-body__content--preview d-flex" >
< img src = { this . state . image } alt = "" / >
< / d i v >
) : null }
{ this . state . video !== null ? (
< div className = "chat-body__content--preview d-flex" >
< ReactPlayer url = { this . state . video } controls / >
< / d i v >
) : null }
{ this . state . music !== null ? (
< div className = "chat-body__content--preview d-flex" >
< ReactAudioPlayer src = { this . state . music } controls / >
< / d i v >
) : null }
{ this . state . document !== null ? (
< div className = "chat-body__content--confirm d-flex" >
< div className = "chat-body__content--confirm___box d-flex flex-column" >
< p > { ` ارسال ( ${ this . state . document . name } ) به ${ this . props . info . title } ؟ ` } < / p >
< div className = "chat-body__content--confirm___box---options d-flex" >
< button
style = { { color : "#00ff00" } }
onClick = { ( ) => this . sendFile ( ) }
>
ارسال
< / b u t t o n >
< button
style = { { color : "#ffffff" } }
onClick = { ( ) => this . cancelSendFile ( ) }
>
کنسل
< / b u t t o n >
< / d i v >
< / d i v >
< / d i v >
) : null }
< / d i v >
< div
className = "chat-body__footer d-flex nobar d-flex flex-column"
onClick = { ( ) => this . addcounter ( "nothing" ) }
>
{ last . action == "text" ? (
< ChatInputs
addcounter = { ( ) => this . addcounter ( ) }
addcounter = { ( ) => this . addcounter ( ) }
isActive = { message . id == last . id }
onStop = { this . onStop }
prevUserId = { i > 0 ? messageList [ i - 1 ] . userId : 0 }
stop = { this . stop }
isSelf = { new Set ( [ 101 , 103 , 106 , 108 , 110 ] ) . has ( message . userId * 1 ) }
start = { this . start }
key = { message . id }
cancel = { this . cancel }
file = { this . state . image }
message = { this . state . message }
document = { this . state . document }
recordState = { this . state . voice }
message = { message }
typeText = { this . typeText }
user = { userIdx [ message . userId ] || { id : 0 , fileId : 0 , name : 'null' } }
sendMessage = { this . sendMessage }
addFile = { this . addFile }
file = { this . state . file }
parent = { this }
/ >
/ >
) : null
) : null }
) }
{ last . action === "keyboard" ? (
{ this . state . image !== null ? (
< Keyboard
< div className = "chat-body__content--preview d-flex" >
options = { last . options }
< img src = { this . state . image } alt = "" / >
addcounter = { ( ) => this . addcounter ( ) }
< / d i v >
/ >
) : null }
) : null }
{ this . state . video !== null ? (
{ this . state . emoji ? (
< div className = "chat-body__content--preview d-flex" >
< div className = "chat-body__footer--emoji d-flex flex-column" >
< ReactPlayer url = { this . state . video } controls / >
< Emoji typeText = { this . typeText } / >
< / d i v >
) : null }
< / d i v >
< / d i v >
) : null }
< ToastContainer
{ this . state . music !== null ? (
position = "top-center"
< div className = "chat-body__content--preview d-flex" >
autoClose = { 1500 }
< ReactAudioPlayer src = { this . state . music } controls / >
hideProgressBar = { true }
newestOnTop = { true }
closeOnClick
rtl = { true }
pauseOnFocusLoss
draggable
pauseOnHover
/ >
< / d i v >
) : null }
{ window . innerWidth > 1000 ? (
< div
className = "desktop-chat-body d-flex flex-column nobar "
onClick = { ( ) => this . addcounter ( "parent" ) }
>
< div
className = "desktop-chat-body__content d-flex flex-column nobar"
id = "chatroom"
style = { {
paddingTop : 10 ,
overflowX : "hidden" ,
overflowY : this . state . file !== null ? "hidden" : "scroll" ,
paddingBottom : last . action === "keyboard" ? 150 : 10 ,
} }
>
{ chatInfo . users &&
messageList . map ( ( message , i ) =>
this . state . image === null &&
this . state . music === null &&
this . state . video === null ? (
< Message
addcounter = { ( ) => this . addcounter ( ) }
isActive = { message . id == last . id }
prevUserId = { i > 0 ? messageList [ i - 1 ] . userId : 0 }
isSelf = { new Set ( [ 101 , 103 , 106 , 108 , 110 ] ) . has (
message . userId * 1
) }
key = { message . id }
file = { this . state . image }
document = { this . state . document }
message = { message }
user = {
userIdx [ message . userId ] || {
id : 0 ,
fileId : 0 ,
name : "null" ,
}
}
/ >
) : null
) }
{ this . state . image !== null ? (
< div className = "desktop-chat-body__content--preview d-flex" >
< img src = { this . state . image } alt = "" / >
< / d i v >
) : null }
{ this . state . video !== null ? (
< div className = "desktop-chat-body__content--preview d-flex" >
< ReactPlayer url = { this . state . video } controls / >
< / d i v >
) : null }
{ this . state . music !== null ? (
< div className = "desktop-chat-body__content--preview d-flex" >
< ReactAudioPlayer src = { this . state . music } controls / >
< / d i v >
) : null }
{ this . state . document !== null ? (
< div className = "desktop-chat-body__content--confirm d-flex" >
< div className = "desktop-chat-body__content--confirm___box d-flex flex-column" >
< p > { ` ارسال ( ${ this . state . document . name } ) به ${ this . props . info . title } ؟ ` } < / p >
< div className = "desktop-chat-body__content--confirm___box---options d-flex" >
< button
style = { { color : "#00ff00" } }
onClick = { ( ) => this . sendFile ( ) }
>
ارسال
< / b u t t o n >
< button
style = { { color : "#ffffff" } }
onClick = { ( ) => this . cancelSendFile ( ) }
>
کنسل
< / b u t t o n >
< / d i v >
< / d i v >
< / d i v >
) : null }
< / d i v >
< / d i v >
) : null }
< div
{ this . state . document !== null ? (
className = "desktop-chat-body__footer d-flex nobar d-flex flex-column"
< div className = "chat-body__content--confirm d-flex" >
onClick = { ( ) => this . addcounter ( "nothing" ) }
< div className = "chat-body__content--confirm___box d-flex flex-column" >
>
< p > { ` ارسال ( ${ this . state . document . name } ) به ${ this . props . info . title } ؟ ` } < / p >
{ last . action == "text" ? (
< div className = "chat-body__content--confirm___box---options d-flex" >
< ChatInputs
< button style = { { color : '#00ff00' } } onClick = { ( ) => this . sendFile ( ) } >
addcounter = { ( ) => this . addcounter ( ) }
ارسال
onStop = { this . onStop }
< / b u t t o n >
stop = { this . stop }
< button style = { { color : '#ffffff' } } onClick = { ( ) => this . cancelSendFile ( ) } >
start = { this . start }
کنسل
cancel = { this . cancel }
< / b u t t o n >
message = { this . state . message }
recordState = { this . state . voice }
typeText = { this . typeText }
sendMessage = { this . sendMessage }
addFile = { this . addFile }
file = { this . state . file }
parent = { this }
/ >
) : null }
{ last . action === "keyboard" ? (
< Keyboard
options = { last . options }
addcounter = { ( ) => this . addcounter ( ) }
/ >
) : null }
{ this . state . emoji ? (
< div className = "desktop-chat-body__footer--emoji d-flex flex-column" >
< Emoji typeText = { this . typeText } / >
< / d i v >
< / d i v >
< / d i v >
) : null }
< / d i v >
< / d i v >
) : null }
< ToastContainer
< / d i v >
position = "top-center"
< div
autoClose = { 1500 }
className = "chat-body__footer d-flex nobar d-flex flex-column"
hideProgressBar = { true }
onClick = { ( ) => this . addcounter ( 'nothing' ) }
newestOnTop = { true }
>
closeOnClick
{ last . action == 'text' ? (
rtl = { true }
< ChatInputs
pauseOnFocusLoss
addcounter = { ( ) => this . addcounter ( ) }
draggable
onStop = { this . onStop }
pauseOnHover
stop = { this . stop }
start = { this . start }
cancel = { this . cancel }
message = { this . state . message }
recordState = { this . state . voice }
typeText = { this . typeText }
sendMessage = { this . sendMessage }
addFile = { this . addFile }
file = { this . state . file }
parent = { this }
/ >
/ >
) : null }
< / d i v >
{ last . action === 'keyboard' ? (
) : null }
< Keyboard options = { last . options } addcounter = { ( ) => this . addcounter ( ) } / >
< / >
) : null }
{ this . state . emoji ? (
< div className = "chat-body__footer--emoji d-flex flex-column" >
< Emoji typeText = { this . typeText } / >
< / d i v >
) : null }
< / d i v >
< ToastContainer
position = "top-center"
autoClose = { 1500 }
hideProgressBar = { true }
newestOnTop = { true }
closeOnClick
rtl = { true }
pauseOnFocusLoss
draggable
pauseOnHover
/ >
< / d i v >
) ;
) ;
}
}
}
}