@iterable/react-native-sdk - v2.0.3
    Preparing search index...

    Interface IterableInboxMessageCellProps

    Props for the IterableInboxMessageCell component.

    interface IterableInboxMessageCellProps {
        contentWidth: number;
        customizations: IterableInboxCustomizations;
        dataModel: IterableInboxDataModel;
        deleteRow: (messageId: string) => void;
        handleMessageSelect: (messageId: string, index: number) => void;
        index: number;
        isPortrait: boolean;
        last: boolean;
        messageListItemLayout: (
            isLast: boolean,
            rowViewModel: IterableInboxRowViewModel,
        ) => undefined | null | [ReactNode, number];
        rowViewModel: IterableInboxRowViewModel;
        swipingCheck: (swiping: boolean) => void;
    }
    Index

    Properties

    contentWidth: number

    The width of the content.

    Customizations for the inbox message cell.

    The data model for the inbox message.

    deleteRow: (messageId: string) => void

    Function to delete a message row.

    Type Declaration

      • (messageId: string): void
      • Parameters

        • messageId: string

          The ID of the message to delete.

        Returns void

    handleMessageSelect: (messageId: string, index: number) => void

    Function to handle message selection.

    Type Declaration

      • (messageId: string, index: number): void
      • Parameters

        • messageId: string

          The ID of the message to select.

        • index: number

          The index of the message to select.

        Returns void

    index: number

    The index of the message cell.

    isPortrait: boolean

    Indicates if the device is in portrait mode.

    last: boolean

    Indicates if this is the last message cell in a list.

    messageListItemLayout: (
        isLast: boolean,
        rowViewModel: IterableInboxRowViewModel,
    ) => undefined | null | [ReactNode, number]

    Function to specify a layout for the message row.

    Type Declaration

      • (
            isLast: boolean,
            rowViewModel: IterableInboxRowViewModel,
        ): undefined | null | [ReactNode, number]
      • Parameters

        • isLast: boolean

          Is this the last message in the list?

        • rowViewModel: IterableInboxRowViewModel

          The view model for the inbox row.

        Returns undefined | null | [ReactNode, number]

        A tuple containing a React node and a number, or undefined/null.

    To specify a custom layout for your inbox rows, when you instantiate your IterableInbox, assign a function to its messageListItemLayout prop. The inbox will call this function for each of its rows, and it should return:

    1. JSX that represents the custom layout for the row.
    2. The height of the row (must be the same for all rows).
     const ROW_HEIGHT = 100;

    // Custom layout for the message row
    const renderCustomLayout = (
    isLast: boolean,
    rowViewModel: IterableInboxRowViewModel,
    ) => {
    return [
    // Component shown in the message row
    <View>
    <Text>Title: {rowViewModel.inAppMessage.inboxMetadata?.title}</Text>
    <Text>Body: {rowViewModel.inAppMessage.inboxMetadata?.subtitle}</Text>
    <Text>Date: {rowViewModel.createdAt}</Text>
    <Text>Has been read: {rowViewModel.read === true}</Text>
    </View>,
    // Height of the row
    ROW_HEIGHT,
    ];
    }

    <IterableInbox messageListItemLayout={renderCustomLayout} />

    The view model for the inbox row.

    swipingCheck: (swiping: boolean) => void

    Function to check if swiping should be enabled.

    Type Declaration

      • (swiping: boolean): void
      • Parameters

        • swiping: boolean

          Should swiping be enabled?

        Returns void