Skip to content

Commit

Permalink
Move audio elements to component wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
arnautov-anton committed Sep 26, 2023
1 parent d9effac commit 81ea1a0
Showing 1 changed file with 28 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,41 +109,37 @@ export const PaginatedGridLayout = ({
if (!call) return null;

return (
<>
<div className="str-video__paginated-grid-layout__wrapper">
{remoteParticipants.map((participant) => (
<Audio key={participant.sessionId} participant={participant} />
))}
<div className="str-video__paginated-grid-layout__wrapper">
<div className="str-video__paginated-grid-layout">
{pageArrowsVisible && pageCount > 1 && (
<IconButton
icon="caret-left"
disabled={page === 0}
onClick={() =>
setPage((currentPage) => Math.max(0, currentPage - 1))
}
/>
)}
{selectedGroup && (
<PaginatedGridLayoutGroup
group={participantGroups[page]}
VideoPlaceholder={VideoPlaceholder}
ParticipantViewUI={ParticipantViewUI}
/>
)}
{pageArrowsVisible && pageCount > 1 && (
<IconButton
disabled={page === pageCount - 1}
icon="caret-right"
onClick={() =>
setPage((currentPage) =>
Math.min(pageCount - 1, currentPage + 1),
)
}
/>
)}
</div>
<div className="str-video__paginated-grid-layout">
{pageArrowsVisible && pageCount > 1 && (
<IconButton
icon="caret-left"
disabled={page === 0}
onClick={() =>
setPage((currentPage) => Math.max(0, currentPage - 1))
}
/>
)}
{selectedGroup && (
<PaginatedGridLayoutGroup
group={participantGroups[page]}
VideoPlaceholder={VideoPlaceholder}
ParticipantViewUI={ParticipantViewUI}
/>
)}
{pageArrowsVisible && pageCount > 1 && (
<IconButton
disabled={page === pageCount - 1}
icon="caret-right"
onClick={() =>
setPage((currentPage) => Math.min(pageCount - 1, currentPage + 1))
}
/>
)}
</div>
</>
</div>
);
};

0 comments on commit 81ea1a0

Please sign in to comment.