-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
113 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import "./index.less" | ||
import {memo, useEffect, useState} from "react"; | ||
import {formatTimingTime} from "../../../../utils/date.js"; | ||
|
||
const Call = memo(({value, right = false}) => { | ||
let [msgContent, setMsgContent] = useState(null) | ||
|
||
useEffect(() => { | ||
let content = JSON.parse(value.msgContent?.content) | ||
console.log(content) | ||
setMsgContent(content) | ||
}, [value]) | ||
|
||
return ( | ||
<> | ||
<div className={"chat-content-call"}> | ||
<div className={`content ${right ? "right" : ""}`}> | ||
<i className={`iconfont icon ${msgContent?.type === "audio" ? "icon-dianhua" : "icon-shipin"}`} | ||
style={{fontSize: 20, margin: "0 4px"}}/> | ||
<div> | ||
{ | ||
msgContent?.time > 0 ? `通话时长 ${formatTimingTime(msgContent.time)}` : "通话未接通" | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
}) | ||
export default Call; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.chat-content-call { | ||
display: flex; | ||
flex-direction: row; | ||
margin-bottom: 10px; | ||
white-space: pre-wrap; | ||
word-break: break-all; | ||
word-wrap: break-word; | ||
height: 34px; | ||
|
||
.content { | ||
background-color: #ffffff; | ||
width: 150px; | ||
height: 32px; | ||
border-radius: 5px; | ||
display: flex; | ||
align-items: center; | ||
font-size: 14px; | ||
user-select: none; | ||
} | ||
|
||
.content.right { | ||
color: #FFFFFF; | ||
background-color: #4C9BFF; | ||
margin-left: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters