mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
wip: get chapters
This commit is contained in:
parent
40496f7ced
commit
c2b3e51ad0
5 changed files with 53 additions and 12 deletions
|
|
@ -22,7 +22,7 @@ function Chapter(props: any) {
|
|||
<Draggable key={props.info.list.chapter.id} draggableId={props.info.list.chapter.id} index={props.index}>
|
||||
{(provided, snapshot) => (
|
||||
<ChapterWrapper {...provided.dragHandleProps} {...provided.draggableProps} ref={provided.innerRef} isDragging={snapshot.isDragging} key={props.info.list.chapter.id}>
|
||||
<h3>{props.info.list.chapter.title}</h3>
|
||||
<h3>{props.info.list.chapter.name}</h3>
|
||||
<Droppable droppableId={props.info.list.chapter.id} type="element">
|
||||
{(provided) => (
|
||||
<ElementsList {...provided.droppableProps} ref={provided.innerRef}>
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ export const initialData = {
|
|||
"element-5": { id: "element-5", content: "Fifth element" },
|
||||
},
|
||||
chapters: {
|
||||
"chapter-1": { id: "chapter-1", title: "Chapter 1", elementIds: ["element-1", "element-2", "element-3"] },
|
||||
"chapter-2": { id: "chapter-2", title: "Chapter 2", elementIds: ["element-4"] },
|
||||
"chapter-3": { id: "chapter-3", title: "Chapter 3", elementIds: ["element-5"] },
|
||||
"chapter-1": { id: "chapter-1", name: "Chapter 1", elementIds: ["element-1", "element-2", "element-3"] },
|
||||
"chapter-2": { id: "chapter-2", name: "Chapter 2", elementIds: ["element-4"] },
|
||||
"chapter-3": { id: "chapter-3", name: "Chapter 3", elementIds: ["element-5"] },
|
||||
},
|
||||
|
||||
chapterOrder: ["chapter-1", "chapter-2", "chapter-3"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue