setNewMessage(e.target.value)}
onKeyPress={handleKeyPress}
- className="w-4/5 px-4 py-3 rounded-2xl"
+ className="w-4/5 px-4 py-3 rounded-2xl focus:outline-none"
/>
-
+
{user.id === myId ? (
-
+
{changeTime(message.createdAt.toString())}
-
+
+ {message.text}
+
) : (
@@ -52,14 +50,17 @@ const Chats = ({
height={50}
alt="User Picture"
onClick={useModal ? openProfile : undefined}
+ className="shadow-gray-100 shadow-md rounded-xl"
/>
{user.username}
-
+
{message.text}
- {changeTime(message.createdAt.toString())}
+
+ {changeTime(message.createdAt.toString())}
+
)}
>
diff --git a/Components/Chat/RenderChats.tsx b/Components/Chat/RenderChats.tsx
index 86c7e88..d8181db 100644
--- a/Components/Chat/RenderChats.tsx
+++ b/Components/Chat/RenderChats.tsx
@@ -29,40 +29,38 @@ const RenderChats = ({
}, [messages.length]);
return (
- <>
-
- {messages.map((message, index) => {
- const myUser = chatUsers.find((user) => user.id === message.userId);
+
+ {messages.map((message, index) => {
+ const myUser = chatUsers.find((user) => user.id === message.userId);
- if (myUser) {
- return (
-
- {index === 0 ||
- new Date(message.createdAt).toDateString() !==
- new Date(messages[index - 1].createdAt).toDateString() ? (
- -
-
- {new Date(message.createdAt).toDateString()}
-
-
- ) : null}
-
-
- );
- }
- })}
-
-
- >
+ if (myUser) {
+ return (
+
+ {index === 0 ||
+ new Date(message.createdAt).toDateString() !==
+ new Date(messages[index - 1].createdAt).toDateString() ? (
+ -
+
+ {new Date(message.createdAt).toDateString()}
+
+
+ ) : null}
+
+
+ );
+ }
+ })}
+
+
);
};
export default RenderChats;
diff --git a/tailwind.config.ts b/tailwind.config.ts
index 251e132..df9260b 100644
--- a/tailwind.config.ts
+++ b/tailwind.config.ts
@@ -31,6 +31,10 @@ const config: Config = withMT({
bgfill: '#7E7E7E',
chat: '#5B5B5B',
bglight: '#EFEFEF',
+ footer: '#FFB8DA',
+ send: '#FB72B4',
+ users: '#848484',
+ time: '#7E7E7E',
},
backgroundImage: {
'trash-can': "url('../public/icon_trash.svg')",