Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preview list styling #1072

Merged
merged 1 commit into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions src/components/Messages/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Preview: FC<Props> = ({ profile, message, conversationKey, isSelected }) =
)}
onClick={() => onConversationSelected(profile.id)}
>
<div className="flex justify-between space-x-3 px-5">
<div className="flex justify-between space-x-3 px-3">
<img
src={getAvatar(profile)}
loading="lazy"
Expand All @@ -49,21 +49,25 @@ const Preview: FC<Props> = ({ profile, message, conversationKey, isSelected }) =
width={40}
alt={profile?.handle}
/>
<div className="w-full">
<div className="flex w-full justify-between space-x-1">
<div className="flex gap-1 items-center max-w-sm">
<div className={`line-clamp-1 ${clsx('text-md')}`}>{profile?.name ?? profile.handle}</div>
{isVerified(profile?.id) && <BadgeCheckIcon className="min-w-fit w-4 h-4 text-brand" />}
<div className="w-full flex">
<div className="flex-col w-[65%]">
<div className="flex w-full justify-between space-x-1">
<div className="flex gap-1 items-center max-w-sm">
<div className={`line-clamp-1 ${clsx('text-md')}`}>{profile?.name ?? profile.handle}</div>
{isVerified(profile?.id) && <BadgeCheckIcon className="min-w-fit w-4 h-4 text-brand" />}
</div>
</div>
<span className="text-sm text-gray-500 line-clamp-1 break-words">
{address === message.senderAddress && 'You: '} {message.content.substring(0, 16)}
</span>
</div>
<div className="flex ml-4 w-[35%]">
{message.sent && (
<span className="min-w-fit pt-0.5 text-xs text-gray-500">
<span className="min-w-fit pt-0.5 text-xs text-gray-500 text-right w-full">
{dayjs(new Date(message.sent)).fromNow()}
</span>
)}
</div>
<span className="text-sm text-gray-500 line-clamp-1">
{address === message.senderAddress && 'You: '} {message.content}
</span>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Messages/PreviewList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const PreviewList: FC<Props> = ({ className, selectedConversationKey }) => {
</button>
)}
</div>
<div className="h-full overflow-y-auto">
<div className="h-full overflow-y-auto overflow-x-hidden">
{showAuthenticating ? (
<PageLoading message="Awaiting signature to enable DMs" />
) : showLoading ? (
Expand Down