[questions][ui] add hover

pull/346/head
wlren 3 years ago
parent d4df4a9bc1
commit 9c2625105a

@ -7,6 +7,7 @@ import VotingButtons from '../VotingButtons';
export type AnswerCardProps = { export type AnswerCardProps = {
authorImageUrl: string; authorImageUrl: string;
authorName: string; authorName: string;
commentCount: number;
content: string; content: string;
createdAt: Date; createdAt: Date;
upvoteCount: number; upvoteCount: number;
@ -18,9 +19,10 @@ function AnswerCardWithoutHref({
upvoteCount, upvoteCount,
content, content,
createdAt, createdAt,
commentCount,
}: AnswerCardProps) { }: AnswerCardProps) {
return ( return (
<div className="flex gap-4 rounded-md border p-2"> <div className="flex gap-4 rounded-md border bg-white p-2 hover:bg-slate-50">
<VotingButtons size="sm" upvoteCount={upvoteCount} /> <VotingButtons size="sm" upvoteCount={upvoteCount} />
<div className="mt-1 flex flex-col gap-1"> <div className="mt-1 flex flex-col gap-1">
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
@ -34,6 +36,9 @@ function AnswerCardWithoutHref({
</p> </p>
</div> </div>
<p className="pl-1 pt-1">{content}</p> <p className="pl-1 pt-1">{content}</p>
<p className="py-1 pl-3 text-sm font-light underline underline-offset-4">
{commentCount} comment(s)
</p>
</div> </div>
</div> </div>
); );

@ -64,7 +64,7 @@ export default function QuestionCard({
location, location,
}: QuestionCardProps) { }: QuestionCardProps) {
return ( return (
<article className="flex gap-4 rounded-md border border-slate-300 bg-white p-4"> <article className="flex gap-4 rounded-md border border-slate-300 bg-white p-4 hover:bg-slate-50">
{showVoteButtons && <VotingButtons upvoteCount={upvoteCount} />} {showVoteButtons && <VotingButtons upvoteCount={upvoteCount} />}
<div className="flex flex-col gap-2"> <div className="flex flex-col gap-2">
<div className="flex items-baseline justify-between"> <div className="flex items-baseline justify-between">

Loading…
Cancel
Save