feat: wrap reply and post user images in link to user profile
This commit is contained in:
@@ -46,13 +46,15 @@ export default function Post({
|
||||
return (
|
||||
<div className='flex w-full gap-4 p-8 bg-white dark:bg-secondary-gray flex-wrap'>
|
||||
<div className='flex-shrink-0'>
|
||||
<Image
|
||||
alt='user profile image'
|
||||
src={post.user.clerkImageUrl}
|
||||
width={40}
|
||||
height={40}
|
||||
className='rounded-full object-cover border-4 border-primary-accent'
|
||||
/>
|
||||
<Link href={`/profile/${post.user.clerkUserId}`}>
|
||||
<Image
|
||||
alt='user profile image'
|
||||
src={post.user.clerkImageUrl}
|
||||
width={40}
|
||||
height={40}
|
||||
className='rounded-full object-cover border-4 border-primary-accent'
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
<div className='flex flex-1 flex-col gap-2 min-w-0'>
|
||||
<div className='flex items-center justify-between gap-2'>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { PostWithUserDto } from '@/app/types';
|
||||
import { useUser } from '@clerk/nextjs';
|
||||
import { Text } from '@codemirror/state';
|
||||
import Image from 'next/image';
|
||||
import Link from 'next/link';
|
||||
import PostActionButton from './PostActionButtons';
|
||||
import PostActionModal from './PostActionModal';
|
||||
import PostContent from './PostContent';
|
||||
@@ -17,13 +18,15 @@ export default function Reply({ post }: { post: PostWithUserDto }) {
|
||||
return (
|
||||
<div className='flex w-full gap-4'>
|
||||
<div>
|
||||
<Image
|
||||
alt='user profile image'
|
||||
src={post.user.clerkImageUrl}
|
||||
width={40}
|
||||
height={40}
|
||||
className='rounded-full object-cover border-4 border-primary-accent'
|
||||
/>
|
||||
<Link href={`/profile/${post.user.clerkUserId}`}>
|
||||
<Image
|
||||
alt='user profile image'
|
||||
src={post.user.clerkImageUrl}
|
||||
width={40}
|
||||
height={40}
|
||||
className='rounded-full object-cover border-4 border-primary-accent'
|
||||
/>
|
||||
</Link>
|
||||
</div>
|
||||
<div className='flex flex-col flex-1 w-full border border-gray-600 rounded-md'>
|
||||
<div className='flex flex-col w-full p-1'>
|
||||
|
||||
@@ -8,7 +8,7 @@ import Loader from './Loader';
|
||||
import Post from './Post';
|
||||
|
||||
export default function UserPosts({ user }: { user: UserDto }) {
|
||||
const PAGE_SIZE = 10;
|
||||
const PAGE_SIZE = 1;
|
||||
const pager = usePaginatedQuery(
|
||||
api.posts.getUsersPostById,
|
||||
{
|
||||
@@ -42,12 +42,12 @@ export default function UserPosts({ user }: { user: UserDto }) {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='flex flex-col items-center w-full gap-4'>
|
||||
<div className='flex flex-col items-center w-full'>
|
||||
<div className='flex flex-col items-center w-full'>
|
||||
{postsWithUser.map(post => (
|
||||
<div
|
||||
key={post._id}
|
||||
className='w-full border border-t-0 border-gray-600 first:border-t last:rounded-b-md p-1'
|
||||
className='w-full border border-t-0 border-gray-600 first:border-t last:rounded-b-md p-1 last:mb-4'
|
||||
>
|
||||
<Post post={post} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user