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