Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #13 - Allow dragging widgets to reorder #45

Merged
merged 1 commit into from
Nov 19, 2020
Merged

Conversation

mblaul
Copy link
Contributor

@mblaul mblaul commented Nov 18, 2020

Adding drag and drop to the widget cards for reordering
Adding react-sortable-hoc for drag-n-drop features
Putting the sorting logic and components in SortableWidgetContainer
Turning the widget titles into drag handles for the cards

Sorry this took a while @emibcn, thanks again for checking in periodically. Pull this down and try it out. Let me know what you think!

Notes

  • The card title is the draggable handle.
  • There is no resizing in this PR unfortunately, the dnd seemed like enough for me. 馃ぃ
  • localStorage and the URL looked good to me. After moving cards around I could turn the app off and back on and their positions persisted.
  • I added arrayMove with react-sortable-hoc because that's what they use in their docs. We could probably roll our own but I felt this was the simplest thing to do.

Adding drag and drop to the widget cards for reordering
Adding react-sortable-hoc for drag-n-drop features
Putting the sorting logic and components in SortableWidgetContainer
Turning the widget titles into drag handles for the cards
@emibcn emibcn linked an issue Nov 19, 2020 that may be closed by this pull request
@emibcn emibcn merged commit c91da93 into emibcn:master Nov 19, 2020
@emibcn
Copy link
Owner

emibcn commented Nov 19, 2020

Great!! Love your code: very clean, split logic, well indented and strategically commented. If I could, I'd give you a 10!

@emibcn
Copy link
Owner

emibcn commented Nov 19, 2020

Thanked again!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow dragging widgets to reorder
2 participants