Skip to content

Commit

Permalink
chat layout
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalmi committed Aug 2, 2023
1 parent 8dea941 commit 2c10597
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/js/components/PrivateMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
11 changes: 4 additions & 7 deletions src/js/views/chat/ChatMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,17 @@ 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>,
);
}
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;
Expand Down

0 comments on commit 2c10597

Please sign in to comment.