MediaSFU ReactJS
    Preparing search index...

    Variable ShareEventModalConst

    ShareEventModal: React.FC<ShareEventModalOptions> = ...

    ShareEventModal - A modal component for sharing event/meeting details with participants.

    This component provides a comprehensive interface for displaying and sharing meeting information including room IDs, passcodes, and integration with social sharing buttons. It intelligently adapts content based on user permissions and event type.

    Key Features:

    • Meeting ID Display: Shows formatted room name/ID with copy functionality via MeetingIdComponent
    • Admin Passcode: Conditionally displays admin passcode for hosts (level "2")
    • Share Buttons: Optional integration with ShareButtonsComponent for social/email sharing
    • Event Type Support: Adapts display for different event types (meeting, webinar, conference, broadcast, chat)
    • Flexible Positioning: Configurable modal position (topRight, topLeft, bottomRight, bottomLeft)
    • Local Links: Support for custom local links for event access
    • Component Integration: Seamless integration with MeetingIdComponent, MeetingPasscodeComponent, ShareButtonsComponent
    • HTML Attributes: Granular control over all UI elements (overlay, content, header, sections)
    • Render Hooks: Complete override capability for header, sections, and layout
    • Responsive Design: Automatic positioning and responsive behavior
    • Accessibility: Semantic structure with clear sections and close functionality

    Configuration options for ShareEventModal

    Background color for modal content

    Controls modal visibility

    Callback function invoked when modal is closed

    Controls visibility of social share buttons

    Modal screen position

    Meeting/room identifier to be shared

    Admin passcode for host access (only shown to hosts)

    User permission level ("2" = host, shows admin passcode)

    Type of event (meeting, webinar, conference, broadcast, chat)

    Custom local link for event access

    HTML attributes for overlay container

    HTML attributes for content wrapper

    HTML attributes for header section

    HTML attributes for close button

    Custom close icon component

    FontAwesome icon props for close icon

    HTML attributes for divider elements

    HTML attributes for body section

    HTML attributes for passcode wrapper

    Props for MeetingPasscodeComponent

    HTML attributes for meeting ID wrapper

    Props for MeetingIdComponent

    HTML attributes for share buttons wrapper

    Props for ShareButtonsComponent

    Custom render function for header

    Custom render function for close button

    Custom render function for divider

    Custom render function for meeting passcode section

    Custom render function for meeting ID section

    Custom render function for share buttons

    Custom render function for modal body

    Custom render function for entire content

    The rendered ShareEventModal component

    // Basic usage for sharing meeting details

    import React, { useState } from 'react';
    import { ShareEventModal } from 'mediasfu-reactjs';

    const BasicShareModal = () => {
    const [showModal, setShowModal] = useState(true);

    return (
    <ShareEventModal
    isShareEventModalVisible={showModal}
    onShareEventClose={() => setShowModal(false)}
    roomName="meeting-room-123"
    eventType="meeting"
    islevel="2"
    adminPasscode="ADMIN2024"
    shareButtons={true}
    />
    );
    };

    // Custom styled for different event types

    import React, { useState } from 'react';
    import { ShareEventModal } from 'mediasfu-reactjs';

    const WebinarShareModal = () => {
    const [showModal, setShowModal] = useState(true);

    return (
    <ShareEventModal
    isShareEventModalVisible={showModal}
    onShareEventClose={() => setShowModal(false)}
    roomName="webinar-2024-ai"
    eventType="webinar"
    islevel="1"
    backgroundColor="rgba(46, 204, 113, 0.3)"
    position="bottomRight"
    localLink="https://mywebinar.com/join/webinar-2024-ai"
    contentProps={{
    style: {
    borderRadius: '12px',
    boxShadow: '0 4px 20px rgba(0,0,0,0.1)'
    }
    }}
    headerProps={{
    style: {
    background: 'linear-gradient(135deg, #2ecc71, #27ae60)',
    color: '#fff',
    padding: '16px'
    }
    }}
    />
    );
    };

    // Analytics tracking for share interactions

    import React, { useState } from 'react';
    import { ShareEventModal } from 'mediasfu-reactjs';

    const AnalyticsShareModal = () => {
    const [showModal, setShowModal] = useState(true);

    const handleClose = () => {
    analytics.track('Share Modal Closed', {
    roomName: 'meeting-room-123',
    eventType: 'conference'
    });
    setShowModal(false);
    };

    return (
    <ShareEventModal
    isShareEventModalVisible={showModal}
    onShareEventClose={handleClose}
    roomName="meeting-room-123"
    eventType="conference"
    islevel="2"
    adminPasscode="CONF2024"
    renderMeetingId={({ defaultMeetingId, roomName }) => {
    // Track when meeting ID is displayed
    React.useEffect(() => {
    analytics.track('Meeting ID Displayed', { roomName });
    }, [roomName]);
    return defaultMeetingId;
    }}
    shareButtonsComponentProps={{
    onShareButtonPress: (platform) => {
    analytics.track('Share Button Clicked', {
    platform,
    roomName: 'meeting-room-123'
    });
    }
    }}
    />
    );
    };

    // Integration with MediasfuGeneric using uiOverrides

    import React, { useState } from 'react';
    import { MediasfuGeneric, ShareEventModal } from 'mediasfu-reactjs';

    const CustomShareComponent = (props) => (
    <ShareEventModal
    {...props}
    position="topLeft"
    renderBody={({ meetingPasscode, meetingId, shareButtons }) => (
    <div className="custom-share-layout">
    <div className="share-info-section">
    <h3>Join This Meeting</h3>
    {meetingId}
    {meetingPasscode && (
    <div className="host-credentials">
    <h4>🔐 Host Credentials</h4>
    {meetingPasscode}
    </div>
    )}
    </div>
    {shareButtons && (
    <div className="share-actions">
    <h4>Share with Others</h4>
    {shareButtons}
    </div>
    )}
    </div>
    )}
    />
    );

    const App = () => {
    const [credentials] = useState({
    apiUserName: 'user123',
    apiKey: 'your-api-key'
    });

    return (
    <MediasfuGeneric
    credentials={credentials}
    uiOverrides={{
    ShareEventModal: CustomShareComponent
    }}
    />
    );
    };
      )}
    />
    

    ); };

    export default App;