-
-
Notifications
You must be signed in to change notification settings - Fork 130
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement drag and drop for area climbs #840
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
883128e
to
325078d
Compare
rowIds={Array.from(areaStore.keys())} | ||
editMode={editMode} | ||
onDragEnd={onDragEnd} | ||
renderRow={(areaId: string, idx: number) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little bit inelegant, but I don't really know of a better design pattern. We need to pass in both the child component and the data to fill it with. One other idea is to pass in a list of childProps.
<DraggableTable ..>
<AreaItem><AreaItem ...>
<DraggableTable ..>
But then we would have to maintain extra state here in the parent component to order the child components, which is worse than slightly ugly code IMO.
I haven't looked at this closely. Quick question, does content in the CSV editor stay in sync? |
Good call out -- it doesn't sync. I'll need to fix that. |
if it's too complicated, I'd prioritize fixing other bugs since there's already an alternate way to order climbs using the bulk editor. |
We let react-hook-form manage the form state. The CSV editor manipulates the climb list here:
Let's postpone this improvement. I think the climb edit page can use some UX improvement |
Obsolete. |
We made subareas drag-and-droppable in #696.
This PR achieves the same for climbs in an area. The main work is to abstract out a new
DraggableTable
component which we then re-use for climbs and subareas.