verdnatura-chat/app/containers/UIKit/MessageBlock.js

28 lines
700 B
JavaScript
Raw Normal View History

2020-02-19 19:43:47 +00:00
import React from 'react';
import PropTypes from 'prop-types';
import { UiKitMessage, UiKitModal } from './index';
import { KitContext } from './utils';
export const messageBlockWithContext = context => props => (
<KitContext.Provider value={context}>
<MessageBlock {...props} />
</KitContext.Provider>
);
const MessageBlock = ({ blocks }) => UiKitMessage(blocks);
MessageBlock.propTypes = {
blocks: PropTypes.any
};
export const modalBlockWithContext = context => data => (
<KitContext.Provider value={{ ...context, ...data }}>
<ModalBlock {...data} />
</KitContext.Provider>
);
const ModalBlock = ({ blocks }) => UiKitModal(blocks);
ModalBlock.propTypes = {
blocks: PropTypes.any
};