setUsername(e.target.value)}
+ placeholder="Enter name"
+ className="w-full rounded-2xl border border-(--line) bg-white px-4 py-3 text-sm shadow-sm outline-none transition focus:border-slate-400"
+ />
+
+ {/* ONLINE USERS */}
+
{
const el = containerRef.current;
@@ -199,7 +215,7 @@ socket.on("newMessage", (msg) => {
setUnreadCount(0);
}
}}
- className="h-[400px] overflow-y-auto space-y-2 border p-3"
+ className="h-[500px] overflow-y-auto rounded-3xl border border-(--line) bg-white p-5 shadow-sm"
>
{messages.map((msg, i) => {
const prevMsg = messages[i - 1];
@@ -214,20 +230,20 @@ socket.on("newMessage", (msg) => {
}`}
>
+ className={`max-w-sm rounded-2xl p-4 shadow-sm ${
+ isMe
+ ? `bg-teal-700 text-white ${
+ isSameUser
+ ? "rounded-lg rounded-tr-2xl"
+ : "rounded-2xl rounded-br-md"
+ }`
+ : `bg-slate-100 text-slate-800 ${
+ isSameUser
+ ? "rounded-lg rounded-tl-2xl"
+ : "rounded-2xl rounded-bl-md"
+ }`
+ }`}
+>
{/* Show name only for others */}
{!isMe && !isSameUser && (
{msg.user}
@@ -256,7 +272,7 @@ socket.on("newMessage", (msg) => {
))}
-
+
{msg.time} {msg.status === "seen" ? "✓✓" : "✓"}
@@ -288,16 +304,16 @@ socket.on("newMessage", (msg) => {
)}
{/* INPUT */}
-