Make lesson draggable
This commit is contained in:
@@ -57,9 +57,9 @@ export async function setCourseData(data, setLesson = true) {
|
||||
}
|
||||
|
||||
if (setLesson) {
|
||||
const orderedLessons = (data.lessons || []).sort(
|
||||
(a, b) => new Date(a.created_at) - new Date(b.created_at)
|
||||
);
|
||||
const orderedLessons = (data.lessons || [])
|
||||
.sort((a, b) => new Date(a.created_at) - new Date(b.created_at))
|
||||
.sort((a, b) => a.order - b.order);
|
||||
// .map((lesson) => ({
|
||||
// ...lesson,
|
||||
// profile: lesson.profile && tutorsById[lesson.profile.id],
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
// import
|
||||
// border border-gray-300 rounded-md p-3 bg-blue-200 bg-opacity-25
|
||||
export let width = 'max-w-3xl w-11/12';
|
||||
export let padding = 'pb-5 px-4';
|
||||
export let className = '';
|
||||
</script>
|
||||
|
||||
<div class="root mt-4 mx-auto {width} {className} relative pb-5 px-4">
|
||||
<div class="root mt-4 mx-auto {width} {className} relative {padding}">
|
||||
{#if $$slots.header}
|
||||
<div
|
||||
class="head flex items-center justify-between sticky right-0 w-full py-3"
|
||||
|
||||
Reference in New Issue
Block a user