Skip to content

Commit

Permalink
Added a shadow to the PostCard component. (#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik150502 authored Oct 8, 2024
1 parent 9da2796 commit e0b174f
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/components/posts/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,10 @@ const PostCard: React.FC<IProps> = ({

return (
<div
className={`flex w-full cursor-pointer flex-col gap-4 p-3 transition-all duration-300 sm:p-5 ${
!post.content && !isAnswer
? `rounded-xl bg-neutral-50 hover:-translate-y-2 dark:bg-neutral-900`
: `rounded-r-xl border-l-2 border-blue-500 bg-primary/5`
} ${isPending && `animate-pulse duration-700`}`}
className={`flex w-full cursor-pointer flex-col gap-4 p-3 transition-all duration-300 sm:p-5 ${!post.content && !isAnswer
? `rounded-xl bg-neutral-50 shadow-lg hover:-translate-y-2 dark:bg-neutral-900`
: `rounded-r-xl border-l-2 border-blue-500 bg-primary/5`
} ${isPending && `animate-pulse duration-700`}`}
onClick={() => {
startTransition(() => {
if (isExtendedQuestion(post)) {
Expand Down Expand Up @@ -132,12 +131,12 @@ const PostCard: React.FC<IProps> = ({
</div>
{(sessionUser?.role === ROLES.ADMIN ||
post?.author?.id === sessionUser?.id) && (
<DeleteForm
key={post.id}
questionId={!isAnswer ? post.id : undefined}
answerId={isAnswer ? post.id : undefined}
/>
)}
<DeleteForm
key={post.id}
questionId={!isAnswer ? post.id : undefined}
answerId={isAnswer ? post.id : undefined}
/>
)}
</div>

{parentAuthorName && isAnswer && (
Expand Down Expand Up @@ -216,10 +215,10 @@ const PostCard: React.FC<IProps> = ({
</div>

{enableReply && (
<form
onSubmit={handleSubmit}
className="mt-4"
onClick={handleEditorClick}
<form
onSubmit={handleSubmit}
className="mt-4"
onClick={handleEditorClick}
>
<div data-color-mode={theme} className="flex w-full flex-col gap-4">
<MDEditor
Expand Down Expand Up @@ -255,7 +254,7 @@ const PostCard: React.FC<IProps> = ({
sessionUser={sessionUser}
reply={false}
parentAuthorName={post.author.name}
isAnswer={true} />
isAnswer={true} />
</div>
))}
</div>
Expand Down

0 comments on commit e0b174f

Please sign in to comment.