mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
Add authenticated user profile page with locked-down account endpoint (#315)
This commit is contained in:
@@ -54,3 +54,14 @@ export const Liked: Story = {
|
||||
await expect(canvas.getByRole('button', { name: /13 likes/i })).toBeInTheDocument();
|
||||
},
|
||||
};
|
||||
|
||||
export const WithLinkedAccount: Story = {
|
||||
args: { comment: { ...comment, userAccountId: '11111111-1111-1111-1111-111111111111' } },
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
await expect(canvas.getByRole('link', { name: 'malt_kettle' })).toHaveAttribute(
|
||||
'href',
|
||||
'/users/11111111-1111-1111-1111-111111111111',
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Heart, HeartSolid } from 'iconoir-react';
|
||||
import { Link } from 'react-router';
|
||||
import StarRating from '../../shared/StarRating';
|
||||
import type { FillerComment } from '../../../utils/filler-brewery-detail';
|
||||
|
||||
@@ -19,7 +20,16 @@ const CommentItem = ({ comment, onToggleLike }: CommentItemProps) => {
|
||||
</div>
|
||||
<div className="flex-1 flex flex-col gap-1 min-w-0">
|
||||
<div className="flex items-baseline gap-2 flex-wrap">
|
||||
<span className="font-bold text-sm">{comment.user}</span>
|
||||
{comment.userAccountId ? (
|
||||
<Link
|
||||
to={`/users/${comment.userAccountId}`}
|
||||
className="font-bold text-sm link link-hover"
|
||||
>
|
||||
{comment.user}
|
||||
</Link>
|
||||
) : (
|
||||
<span className="font-bold text-sm">{comment.user}</span>
|
||||
)}
|
||||
<StarRating value={comment.rating} size="xs" />
|
||||
<span className="text-xs text-base-content/60">{comment.time}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user