UNPKG

@100mslive/react-native-room-kit

Version:

100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.

29 lines 1.5 kB
import * as React from 'react'; import { StyleSheet, Text } from 'react-native'; import { useHMSLayoutConfig, useHMSRoomStyle } from '../hooks-util'; import { TestIds } from '../utils/constants'; export const HMSPreviewTitle = ({ title = 'Get Started' }) => { const hmsRoomPreviewTitle = useHMSLayoutConfig(layoutConfig => { var _layoutConfig$screens; const previewTitle = layoutConfig === null || layoutConfig === void 0 || (_layoutConfig$screens = layoutConfig.screens) === null || _layoutConfig$screens === void 0 || (_layoutConfig$screens = _layoutConfig$screens.preview) === null || _layoutConfig$screens === void 0 || (_layoutConfig$screens = _layoutConfig$screens.default) === null || _layoutConfig$screens === void 0 || (_layoutConfig$screens = _layoutConfig$screens.elements) === null || _layoutConfig$screens === void 0 || (_layoutConfig$screens = _layoutConfig$screens.preview_header) === null || _layoutConfig$screens === void 0 ? void 0 : _layoutConfig$screens.title; return previewTitle || title; }); const titleStyles = useHMSRoomStyle((theme, typography) => ({ color: theme.palette.on_surface_high, fontFamily: `${typography.font_family}-SemiBold` })); return /*#__PURE__*/React.createElement(Text, { testID: TestIds.title, style: [styles.title, titleStyles] }, hmsRoomPreviewTitle); }; const styles = StyleSheet.create({ title: { fontSize: 24, lineHeight: 32, textAlign: 'center' } }); //# sourceMappingURL=HMSPreviewTitle.js.map