2017-06-05 13:00:02 -05:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
2023-05-12 13:24:50 +03:00
|
|
|
import { StyleType, getFixedPlatformStyle } from '../../../styles/functions.web';
|
2022-03-02 12:47:38 -06:00
|
|
|
|
2017-06-05 13:00:02 -05:00
|
|
|
/**
|
|
|
|
|
* Implements a React/Web {@link Component} for displaying text similar to React
|
2021-03-16 11:59:33 -04:00
|
|
|
* Native's {@code Text} in order to facilitate cross-platform source code.
|
2017-06-05 13:00:02 -05:00
|
|
|
*
|
2021-11-04 22:10:43 +01:00
|
|
|
* @augments Component
|
2017-06-05 13:00:02 -05:00
|
|
|
*/
|
2023-04-03 16:33:18 +03:00
|
|
|
export default class Text extends Component<React.HTMLProps<HTMLSpanElement>> {
|
2017-06-05 13:00:02 -05:00
|
|
|
/**
|
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
|
*
|
|
|
|
|
* @inheritdoc
|
|
|
|
|
* @returns {ReactElement}
|
|
|
|
|
*/
|
|
|
|
|
render() {
|
2023-05-12 13:24:50 +03:00
|
|
|
// eslint-disable-next-line react/prop-types
|
|
|
|
|
const _style = getFixedPlatformStyle(this.props.style as StyleType);
|
2022-03-02 12:47:38 -06:00
|
|
|
|
|
|
|
|
return React.createElement('span', {
|
|
|
|
|
...this.props,
|
|
|
|
|
style: _style
|
|
|
|
|
});
|
2017-06-05 13:00:02 -05:00
|
|
|
}
|
|
|
|
|
}
|