rsm-hcd / AndcultureCode.JavaScript.React.Components

Common atomically designed react components used at andculture
6 stars 8 forks source link

Merge DragAndDropListBox into ListBox #95

Closed alexgetty closed 3 years ago

alexgetty commented 3 years ago

In an effort to reduce duplicate components with variant functionality, I think that the drag and drop functionality should be broken out into a reusable utility/component, then add an 'isDraggable' boolean prop to the ListBox component.

brandongregoryscott commented 3 years ago

Responding similarly to #90 - my hesitation for this, again, would just be growing logic that would live inside ListBox to accommodate drag & drop. This feels like a separate component just like it would feel like a separate function if isDraggable was a regular argument - see https://github.com/AndcultureCode/AndcultureCode/blob/main/clean-code/FUNCTIONS.md#do-one-thing as an example. Perhaps it can be done with minor duplication/overhead, but I'm not sure it's a big deal to keep broken out.

alexgetty commented 3 years ago

Is there a way we can abstract drag and drop functionality into a higher-order component so it can be reused across many different components without growing the complexity of them? I don't have much experience with that so I'm not sure if it would be an appropriate solution in this case.

brandongregoryscott commented 3 years ago

Closing this as we have since removed both components from the package