Add Radio with popover

New commponent Radio with popover is required to show properly popover in DDF wizard
This commit is contained in:
Karel Hala 2021-06-01 14:21:38 +02:00 committed by Sanne Raymaekers
parent 2d777bd30d
commit 0644cbd584
5 changed files with 70 additions and 39 deletions

View file

@ -0,0 +1,19 @@
import React, { useRef } from 'react';
import Radio from '@data-driven-forms/pf4-component-mapper/radio';
import PropTypes from 'prop-types';
const RadioWithPopover = ({ Popover, ...props }) => {
const ref = useRef();
return <>
<Radio { ...props } label={ <span ref={ ref } className="ins-c-image--builder__popover">{props.label}
<Popover appendTo={ ref.current } />
</span> } />
</>;
};
RadioWithPopover.propTypes = {
Popover: PropTypes.elementType.isRequired,
};
export default RadioWithPopover;