mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Implement sidebar Comment Carousel
This commit is contained in:
parent
56c56c9877
commit
fd696a59b4
4 changed files with 98 additions and 0 deletions
27
src/components/sidebar/CommentCarousel.astro
Normal file
27
src/components/sidebar/CommentCarousel.astro
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
---
|
||||
import prismaClient from 'utils/prisma-client'
|
||||
import { Icon } from 'astro-icon/components'
|
||||
|
||||
import SidebarSection from './SidebarSection.astro'
|
||||
import Looper from './CommentCarousel/Looper'
|
||||
|
||||
const comments = await prismaClient.comments.findMany({
|
||||
select: { text: true, albums: { select: { id: true, title: true } } },
|
||||
orderBy: { createdAt: 'desc' },
|
||||
take: 5
|
||||
})
|
||||
---
|
||||
|
||||
<SidebarSection>
|
||||
<Looper comments={comments} client:only='react'>
|
||||
<Icon name='arrow-right' slot='arrowRight' class='group-hover:fill-black' height={30} width={15} fill='white' />
|
||||
<Icon
|
||||
name='arrow-right'
|
||||
slot='arrowLeft'
|
||||
class='group-hover:fill-black scale-x-[-1]'
|
||||
height={30}
|
||||
width={15}
|
||||
fill='white'
|
||||
/>
|
||||
</Looper>
|
||||
</SidebarSection>
|
||||
Loading…
Add table
Add a link
Reference in a new issue