UNPKG

@fto-consult/expo-ui

Version:

Bibliothèque de composants UI Expo,react-native

34 lines (29 loc) • 1.02 kB
import React from "$react"; import { Paragraph } from "react-native-paper"; import {canTextBeSelectable} from "$cplatform"; import {defaultObj,defaultStr,defaultNumber} from "$cutils"; import PropTypes from "prop-types"; import theme from "$theme"; const defaultSelectable = canTextBeSelectable(); function ParagraphComponent({splitText,...props}){ props = defaultObj(props); const restProps = {}; if(splitText){ restProps.numberOfLines = defaultNumber(props.numberOfLines,2); restProps.ellipsizeMode = defaultStr(props.ellipsizeMode,'tail'); } return <Paragraph userSelect = {defaultSelectable} {...props} {...restProps} style = {[{color:theme.colors.text},props.style,restProps.sty]} /> } ParagraphComponent.propTypes = { ...defaultObj(Paragraph.propTypes), numberOfLines : PropTypes.number, splitText : PropTypes.bool, } export default theme.withStyles(ParagraphComponent,{ mode : "normal" });