Fix edit course/module/lesson buttons not scrolling to form
Build and Deploy (Gitea) / build-and-deploy (push) Successful in 46s Details

This commit is contained in:
Sidney Gomes 2026-07-20 19:31:21 -03:00
parent dc13f33455
commit 2045c33525
1 changed files with 7 additions and 6 deletions

View File

@ -148,7 +148,7 @@ export default function AdminContentManager({ token }: AdminContentManagerProps)
});
setShowCourseForm(true);
setTimeout(() => {
window.scrollTo({ top: 0, behavior: 'smooth' });
document.getElementById('admin-content-top')?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}, 50);
};
@ -208,7 +208,7 @@ export default function AdminContentManager({ token }: AdminContentManagerProps)
setModuleForm({ title: mod.title, order: mod.order });
setShowModuleForm(true);
setTimeout(() => {
window.scrollTo({ top: 0, behavior: 'smooth' });
document.getElementById('admin-content-top')?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}, 50);
};
@ -279,16 +279,17 @@ export default function AdminContentManager({ token }: AdminContentManagerProps)
const handleEditLesson = (lesson: Lesson) => {
setEditingLesson(lesson);
setActiveModuleForLesson(lesson.moduleId);
setLessonForm({
title: lesson.title,
videoUrl: lesson.videoUrl,
videoType: lesson.videoType,
order: lesson.order,
content: lesson.content
content: lesson.content || ''
});
setShowLessonForm(true);
setTimeout(() => {
window.scrollTo({ top: 0, behavior: 'smooth' });
document.getElementById('admin-content-top')?.scrollIntoView({ behavior: 'smooth', block: 'start' });
}, 50);
};
@ -320,7 +321,7 @@ export default function AdminContentManager({ token }: AdminContentManagerProps)
}
return (
<div className="space-y-8">
<div id="admin-content-top" className="space-y-8">
{/* Top Header */}
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between border-b border-white/10 pb-5 gap-4">
<div>
@ -443,7 +444,7 @@ export default function AdminContentManager({ token }: AdminContentManagerProps)
{/* --- RENDER COURSE DETAIL / CURRICULUM MANAGER --- */}
{selectedCourse ? (
<div className="space-y-6">
<div id="admin-content-top" className="space-y-6">
{/* Active Course Breadcrumb */}
<div className="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 glass-card p-4 rounded-xl">
<button