feat: wrap reply and post user images in link to user profile

This commit is contained in:
Stevan Freeborn
2023-09-15 13:26:19 -05:00
parent f15621c8f1
commit 508bf2113d
3 changed files with 22 additions and 17 deletions
+2
View File
@@ -46,6 +46,7 @@ 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'>
<Link href={`/profile/${post.user.clerkUserId}`}>
<Image
alt='user profile image'
src={post.user.clerkImageUrl}
@@ -53,6 +54,7 @@ export default function Post({
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'>
+3
View File
@@ -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,6 +18,7 @@ export default function Reply({ post }: { post: PostWithUserDto }) {
return (
<div className='flex w-full gap-4'>
<div>
<Link href={`/profile/${post.user.clerkUserId}`}>
<Image
alt='user profile image'
src={post.user.clerkImageUrl}
@@ -24,6 +26,7 @@ export default function Reply({ post }: { post: PostWithUserDto }) {
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'>
+3 -3
View File
@@ -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>