import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import PropTypes from 'prop-types'; import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit'; import { themes } from '../../constants/colors'; import sharedStyles from '../../views/Styles'; const styles = StyleSheet.create({ content: { marginBottom: 8 }, row: { flexDirection: 'row' }, column: { justifyContent: 'center' }, text: { flex: 1, padding: 4, fontSize: 16, lineHeight: 22, textAlignVertical: 'center', ...sharedStyles.textRegular }, field: { marginVertical: 6 } }); const Accessory = ({ blockId, appId, element, parser }) => parser.renderAccessories( { blockId, appId, ...element }, BLOCK_CONTEXT.SECTION, parser ); const Fields = ({ fields, parser, theme }) => fields.map(field => ( {parser.text(field)} )); const accessoriesRight = ['image', 'overflow']; export const Section = ({ blockId, appId, text, fields, accessory, parser, theme }) => ( {text ? {parser.text(text)} : null} {fields ? : null} {accessory ? : null} ); Section.propTypes = { blockId: PropTypes.string, appId: PropTypes.string, text: PropTypes.object, fields: PropTypes.array, accessory: PropTypes.any, theme: PropTypes.string, parser: PropTypes.object };