feat: real user avatars in reviews, conditional product link

This commit is contained in:
Kirill
2026-05-21 21:10:49 +05:00
parent 7e7bade80c
commit 57da755ea1
4 changed files with 57 additions and 25 deletions
@@ -103,9 +103,9 @@ export function ReviewsBlock() {
<Stack direction="row" spacing={1.5} sx={{ minWidth: { sm: 200 }, alignItems: 'center' }}>
<UserAvatar
userId={r.authorDisplay}
avatarUrl={null}
avatarType={null}
avatarStyle={null}
avatarUrl={r.authorAvatar}
avatarType={r.authorAvatarType}
avatarStyle={r.authorAvatarStyle}
size={40}
/>
<Box>
@@ -122,20 +122,26 @@ export function ReviewsBlock() {
{formatReviewDate(r.createdAt)}
</Typography>
</Stack>
<Typography
variant="caption"
component={RouterLink}
to={`/products/${r.productId}`}
sx={{
display: 'block',
mt: 0.25,
color: 'primary.main',
textDecoration: 'none',
'&:hover': { textDecoration: 'underline' },
}}
>
{r.productTitle}
</Typography>
{r.product.published ? (
<Typography
variant="caption"
component={RouterLink}
to={`/products/${r.product.slug || r.product.id}`}
sx={{
display: 'block',
mt: 0.25,
color: 'primary.main',
textDecoration: 'none',
'&:hover': { textDecoration: 'underline' },
}}
>
{r.product.title}
</Typography>
) : (
<Typography variant="caption" color="text.secondary" sx={{ display: 'block', mt: 0.25 }}>
{r.product.title}
</Typography>
)}
</Box>
</Stack>