Skip to content

Commit

Permalink
feat: disambiguate sender in preview tile (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
saulmc committed Oct 30, 2022
1 parent 9de14c2 commit 6bee0c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Messages/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import relativeTime from 'dayjs/plugin/relativeTime';
import { useRouter } from 'next/router';
import type { FC } from 'react';
import React from 'react';
import { useAppStore } from 'src/store/app';

dayjs.extend(relativeTime);

Expand All @@ -20,6 +21,8 @@ interface Props {

const Preview: FC<Props> = ({ profile, message, conversationKey }) => {
const router = useRouter();
const currentProfile = useAppStore((state) => state.currentProfile);
const address = currentProfile?.ownedBy;

const onConversationSelected = (profileId: string) => {
router.push(profileId ? `/messages/${conversationKey}` : '/messages');
Expand Down Expand Up @@ -51,7 +54,9 @@ const Preview: FC<Props> = ({ profile, message, conversationKey }) => {
</span>
)}
</div>
<span className="text-sm text-gray-500 line-clamp-1">{message.content}</span>
<span className="text-sm text-gray-500 line-clamp-1">
{address === message.senderAddress && 'You: '} {message.content}
</span>
</div>
</div>
</div>
Expand Down

1 comment on commit 6bee0c6

@vercel
Copy link

@vercel vercel bot commented on 6bee0c6 Oct 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.