Skip to content

Commit

Permalink
Merge pull request #171 from cloudflare/more-layout-tweaks
Browse files Browse the repository at this point in the history
More small layout improvements
  • Loading branch information
third774 authored Feb 14, 2025
2 parents fa0961e + 2425e6b commit ab18dbc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/components/Participant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ export const Participant = forwardRef<
className={cn(
'absolute inset-0 h-full w-full object-contain opacity-0 transition-opacity',
isSelf && !isScreenShare && '-scale-x-100',
!isScreenShare && 'object-cover',
{
'opacity-100': isScreenShare
? user.tracks.screenShareEnabled
Expand Down Expand Up @@ -244,7 +245,7 @@ export const Participant = forwardRef<
<div className="flex items-center gap-2 absolute m-2 text-shadow left-1 bottom-1">
<ConnectionIndicator quality={getConnectionQuality(packetLoss)} />
<OptionalLink
className="leading-none"
className="leading-none text-sm"
href={populateTraceLink(user.transceiverSessionId, traceLink)}
target="_blank"
rel="noopener noreferrer"
Expand Down
4 changes: 3 additions & 1 deletion app/components/ParticipantLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import { Participant } from './Participant'
export function ParticipantLayout({
users,
gap,
aspectRatio,
}: {
users: User[]
gap: number
aspectRatio: string
}) {
const $el = useRef<HTMLDivElement>(null)

Expand All @@ -21,7 +23,7 @@ export function ParticipantLayout({
const { width, height, getPosition } = createGrid({
dimensions,
count: users.length,
aspectRatio: '4:3',
aspectRatio,
gap,
})

Expand Down
2 changes: 2 additions & 0 deletions app/routes/_room.$roomName.room.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,15 @@ function JoinedRoom({ bugReportsEnabled }: { bugReportsEnabled: boolean }) {
<ParticipantLayout
users={pinnedActors.filter(isNonNullable)}
gap={gridGap}
aspectRatio="16:9"
/>
</div>
)}
<div className="flex-grow overflow-hidden relative">
<ParticipantLayout
users={unpinnedActors.filter(isNonNullable)}
gap={gridGap}
aspectRatio="4:3"
/>
</div>
</div>
Expand Down

0 comments on commit ab18dbc

Please sign in to comment.