vn-verdnaturachat/app/containers/UIKit/Context.tsx

24 lines
565 B
TypeScript
Raw Normal View History

2020-02-11 14:01:35 +00:00
import React from 'react';
import { StyleSheet, View } from 'react-native';
2020-02-11 14:01:35 +00:00
import PropTypes from 'prop-types';
import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit';
const styles = StyleSheet.create({
container: {
minHeight: 36,
alignItems: 'center',
flexDirection: 'row'
}
});
export const Context = ({ elements, parser }: any) => (
2020-02-11 14:01:35 +00:00
<View style={styles.container}>
{elements.map((element: any) => parser.renderContext(element, BLOCK_CONTEXT.CONTEXT, parser))}
2020-02-11 14:01:35 +00:00
</View>
);
2020-02-11 14:01:35 +00:00
Context.propTypes = {
elements: PropTypes.array,
parser: PropTypes.object
};