jiti-meet/react/features/settings/components/native/FormSectionHeader.js

61 lines
1.2 KiB
JavaScript
Raw Normal View History

// @flow
import React, { Component } from 'react';
import { Text, View } from 'react-native';
import { translate } from '../../../base/i18n';
import styles from './styles';
/**
* The type of the React {@code Component} props of {@link FormSectionHeader}
*/
type Props = {
/**
* The i18n key of the text label of the section.
*/
2018-05-29 12:51:55 +00:00
label: string,
/**
* An external style object passed to the component.
*/
style: Object,
/**
* Invoked to obtain translated strings.
*/
t: Function
}
/**
* Implements a React {@code Component} which renders a section header on a
* form.
*/
class FormSectionHeader extends Component<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @override
* @returns {ReactElement}
*/
render() {
2018-05-29 12:51:55 +00:00
const { label, style, t } = this.props;
return (
<View
style = { [
styles.formSectionTitle,
style
] } >
<Text>
2018-05-29 12:51:55 +00:00
{ t(label) }
</Text>
</View>
);
}
}
export default translate(FormSectionHeader);