chat layout

This commit is contained in:
Martti Malmi 2023-08-02 12:52:49 +03:00
parent 8dea941fe2
commit 2c10597009
2 changed files with 5 additions and 8 deletions

View File

@ -91,7 +91,7 @@ const PrivateMessage = (props) => {
return (
<div
className={`p-2 w-full md:w-2/3 rounded-xl m-2 ${whose} ${seen} ${delivered} flex flex-col items-start`}
className={`p-2 w-full md:w-2/3 rounded-xl mb-1 ${whose} ${seen} ${delivered} flex flex-col items-start`}
>
<div className="w-full">
<div className="mb-2">

View File

@ -119,7 +119,7 @@ function ChatMessages({ id }) {
isDifferentDay = true;
const separatorText = Helpers.getDaySeparatorText(date, dateStr, now, nowStr);
msgListContent.push(
<div className="px-2 py-1 inline-block day-separator bg-black opacity-50 text-white rounded-full">
<div className="px-2 mt-3 mb-4 py-1 inline-block day-separator bg-black opacity-50 text-white rounded-full">
{t(separatorText.toLowerCase())}
</div>,
);
@ -127,12 +127,9 @@ function ChatMessages({ id }) {
previousDateStr = dateStr;
}
let showName = false;
if (
msg.pubkey !== myPub &&
(isDifferentDay || (previousFrom && msg.pubkey !== previousFrom))
) {
msgListContent.push(<div className="from-separator" />);
let showName = isDifferentDay;
if (!isDifferentDay && previousFrom && msg.pubkey !== previousFrom) {
msgListContent.push(<div className="m-2" />);
showName = true;
}
previousFrom = msg.pubkey;