Pagination Component

The Pagination component enables page navigation with support for breakout room logic. It shows page numbers, controls access to breakout rooms based on the user level, and provides customizable layout and styling options.

import React from 'react';
import { Pagination } from 'mediasfu-reactnative-expo';

function App() {
const parameters = {
mainRoomsLength: 3,
memberRoom: 1,
breakOutRoomStarted: true,
breakOutRoomEnded: false,
member: 'John Doe',
breakoutRooms: [/* array of breakout room participants * /],
hostNewRoom: 2,
roomName: 'Room A',
islevel: '2',
showAlert: (alert) => console.log(alert.message),
socket: /* Socket connection * /,
getUpdatedAllParams: () => parameters,
};

return (
<Pagination
totalPages={10}
currentUserPage={1}
parameters={parameters}
backgroundColor="lightgray"
paginationHeight={50}
direction="horizontal"
position="middle"
location="bottom"
/>
);
}

export default App;

Properties

propTypes?: WeakValidationMap<PaginationOptions>

Used to declare the types of the props accepted by the component. These types will be checked during rendering and in development only.

We recommend using TypeScript instead of checking prop types at runtime.

contextTypes?: ValidationMap<any>

Lets you specify which legacy context is consumed by this component.

defaultProps?: Partial<PaginationOptions>

Used to define default values for the props accepted by the component.

type Props = { name?: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

MyComponent.defaultProps = {
name: 'John Doe'
}
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'