// Guest mode -- waiting for admission
import { WaitingRoom } from '@hiyve/rn-react';
import { useWaitingRoom } from '@hiyve/rn-react';
function GuestWaitingScreen({ onGoBack }: { onGoBack: () => void }) {
const { isWaitingForAdmission, wasRejected } = useWaitingRoom();
return (
<WaitingRoom
mode="guest"
isWaitingForAdmission={isWaitingForAdmission}
wasRejected={wasRejected}
onGoBack={onGoBack}
/>
);
}
// Host mode -- managing waiting users
import { WaitingRoom } from '@hiyve/rn-react';
import { useWaitingRoom } from '@hiyve/rn-react';
function HostWaitingPanel() {
const { waitingUsers, admitUser, rejectUser } = useWaitingRoom();
return (
<WaitingRoom
mode="host"
waitingUsers={waitingUsers}
onAdmitUser={admitUser}
onRejectUser={rejectUser}
colors={{ admitButton: '#10b981' }}
labels={{ admitButton: 'Allow', rejectButton: 'Deny' }}
/>
);
}
Waiting room screen for both guests and hosts.
In guest mode, the component displays a centered spinner with a message while the user waits for the host to admit them. If the host rejects the user, the spinner is replaced by a rejection message with an optional "Go Back" button.
In host mode, the component displays a scrollable list of users waiting to join the room. Each row shows the user's display name and provides Admit and Reject buttons. When no users are waiting, an empty-state message is shown.