Ask coding questions

← Back to all posts
How to display two different formats of messages to users
Xenity

So, me and @A1PHA1 are working on a chatting app and we need to display 2 different bubbles for our chat because right now all messages are the same. So what we want to do is show a blue one for the local user and a gray one for other users (on each device so client 1 will see their messages blue and other's messages gray, so will the rest of the clients) but we don't know how to implement that so yeah.. All help is appreciated (link to repl: https://replit.com/@TeamDroplet/Blabbr)

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Xenity
Comments
hotnewtop
Coder100

sure

remember how whenever you send a message you also send a bit of info about who sent the message?

You could do that to compare if the user sent the message or not, and css accordingly.

TheH4ck3r

thz for the help! @Coder100

Coder100

Np
Mark as correct answer? @A1PHA1