Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ul, li {
list-style: none;
}

p {
p1 {
max-width: 500px;
margin-bottom: 12px;
line-height: 24px;
Expand All @@ -136,12 +136,12 @@ p {
flex-direction: row-reverse;
}

.sent p {
.sent p1 {
color: white;
background: #0b93f6;
align-self: flex-end;
}
.received p {
.received p1{
background: #e5e5ea;
color: black;
}
Expand All @@ -152,4 +152,8 @@ img {
border-radius: 50%;
margin: 2px 5px;
}
p {
font-size: 10px;


}
6 changes: 4 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,16 @@ function ChatRoom() {


function ChatMessage(props) {
const { text, uid, photoURL } = props.message;

const { text, uid, photoURL, createdAt } = props.message;
var n = new Date(createdAt * 1000).toLocaleTimeString()

const messageClass = uid === auth.currentUser.uid ? 'sent' : 'received';

return (<>
<div className={`message ${messageClass}`}>
<img src={photoURL || 'https://api.adorable.io/avatars/23/abott@adorable.png'} />
<p>{text}</p>
<p1>{text}<P>{n}</P></p1>
</div>
</>)
}
Expand Down