mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Continue work on brewery page, implement like system
This commit is contained in:
@@ -4,12 +4,12 @@ import Image from 'next/image';
|
||||
import beerPostQueryResult from '@/services/BeerPost/schema/BeerPostQueryResult';
|
||||
import { z } from 'zod';
|
||||
import UserContext from '@/contexts/userContext';
|
||||
import useGetLikeCount from '@/hooks/useGetLikeCount';
|
||||
import useGetBeerPostLikeCount from '@/hooks/useBeerPostLikeCount';
|
||||
import BeerPostLikeButton from '../BeerById/BeerPostLikeButton';
|
||||
|
||||
const BeerCard: FC<{ post: z.infer<typeof beerPostQueryResult> }> = ({ post }) => {
|
||||
const { user } = useContext(UserContext);
|
||||
const { mutate, likeCount } = useGetLikeCount(post.id);
|
||||
const { mutate, likeCount } = useGetBeerPostLikeCount(post.id);
|
||||
|
||||
return (
|
||||
<div className="card card-compact bg-base-300" key={post.id}>
|
||||
@@ -27,14 +27,14 @@ const BeerCard: FC<{ post: z.infer<typeof beerPostQueryResult> }> = ({ post }) =
|
||||
<div className="card-body justify-between">
|
||||
<div className="space-y-1">
|
||||
<Link href={`/beers/${post.id}`}>
|
||||
<h2 className="link-hover link overflow-hidden whitespace-normal text-2xl font-bold lg:truncate lg:text-3xl">
|
||||
<h3 className="link-hover link overflow-hidden whitespace-normal text-2xl font-bold lg:truncate lg:text-3xl">
|
||||
{post.name}
|
||||
</h2>
|
||||
</h3>
|
||||
</Link>
|
||||
<Link href={`/breweries/${post.brewery.id}`}>
|
||||
<h3 className="text-md link-hover link whitespace-normal lg:truncate lg:text-xl">
|
||||
<h4 className="text-md link-hover link whitespace-normal lg:truncate lg:text-xl">
|
||||
{post.brewery.name}
|
||||
</h3>
|
||||
</h4>
|
||||
</Link>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user