expose className on ViewportPane
This commit is contained in:
parent
66e3aea773
commit
41c0b38bf7
@ -6,7 +6,7 @@ import { useDrop } from 'react-dnd';
|
|||||||
// NOTE: If we found a way to make `useDrop` conditional,
|
// NOTE: If we found a way to make `useDrop` conditional,
|
||||||
// Or we provided a HOC of this component, we could provide
|
// Or we provided a HOC of this component, we could provide
|
||||||
// this UI without the DragAndDropContext dependency.
|
// this UI without the DragAndDropContext dependency.
|
||||||
function ViewportPane({ children, isActive, onDrop }) {
|
function ViewportPane({ children, className, isActive, onDrop }) {
|
||||||
const [{ isHovered, isHighlighted }, drop] = useDrop({
|
const [{ isHovered, isHighlighted }, drop] = useDrop({
|
||||||
accept: 'displayset',
|
accept: 'displayset',
|
||||||
// TODO: pass in as prop?
|
// TODO: pass in as prop?
|
||||||
@ -37,7 +37,8 @@ function ViewportPane({ children, isActive, onDrop }) {
|
|||||||
{
|
{
|
||||||
'border-2 border-primary-light -m-px': isActive,
|
'border-2 border-primary-light -m-px': isActive,
|
||||||
'border border-secondary-light': !isActive,
|
'border border-secondary-light': !isActive,
|
||||||
}
|
},
|
||||||
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
@ -48,6 +49,8 @@ function ViewportPane({ children, isActive, onDrop }) {
|
|||||||
ViewportPane.propTypes = {
|
ViewportPane.propTypes = {
|
||||||
/** The ViewportComp */
|
/** The ViewportComp */
|
||||||
children: PropTypes.node.isRequired,
|
children: PropTypes.node.isRequired,
|
||||||
|
/** Classes to append to container */
|
||||||
|
className: PropTypes.string,
|
||||||
/** Bool to show active styling */
|
/** Bool to show active styling */
|
||||||
isActive: PropTypes.bool.isRequired,
|
isActive: PropTypes.bool.isRequired,
|
||||||
/** Function that handles drop events */
|
/** Function that handles drop events */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user