UNPKG

@open-tender/ui

Version:

A component library for use with the Open Tender web app

19 lines (18 loc) 1.16 kB
import React from 'react'; import { makeImageProps, makeImageUrl, makeProps } from '../utils'; import Button from './Button'; import Text from './Text'; import View from './View'; const MenuOther = ({ config, handlers, title, subtitle, item, showSubtitle = true, apiUrl }) => { const imageUrl = makeImageUrl(item); const imageProps = makeImageProps(config, 'menuCategory__image', imageUrl, apiUrl); if (!handlers.browse) return null; return (React.createElement(View, Object.assign({}, makeProps(config, 'menuCategory')), React.createElement(Button, Object.assign({}, makeProps(config, 'menuCategory__button'), { onClick: handlers.browse }), React.createElement(View, Object.assign({}, imageProps)), React.createElement(View, Object.assign({}, makeProps(config, 'menuCategory__content')), React.createElement(Text, Object.assign({}, makeProps(config, 'menuCategory__title'), { text: title })), showSubtitle && subtitle && (React.createElement(Text, Object.assign({}, makeProps(config, 'menuCategory__subtitle'), { text: subtitle }))))))); }; export default MenuOther;