diff --git a/src/App.css b/src/App.css index 70ebe18..0645b7b 100644 --- a/src/App.css +++ b/src/App.css @@ -115,7 +115,7 @@ ul, li { list-style: none; } -p { +p1 { max-width: 500px; margin-bottom: 12px; line-height: 24px; @@ -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; } @@ -152,4 +152,8 @@ img { border-radius: 50%; margin: 2px 5px; } +p { + font-size: 10px; + +} diff --git a/src/App.js b/src/App.js index d7c9417..cb921ae 100644 --- a/src/App.js +++ b/src/App.js @@ -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 (<>
{text}
+{n}