Fixing mobile issue

This commit is contained in:
Ekiserrepé
2026-04-10 08:39:33 +02:00
parent 9f3cb431f2
commit f51a5fe699
2 changed files with 5 additions and 2 deletions

View File

@@ -76,7 +76,6 @@ export default function App() {
setView(nextView)
setActiveModuleIdx(mIdx)
setActiveLessonIdx(lIdx)
window.scrollTo({ top: 0, behavior: 'instant' })
}
const openLesson = (mIdx, lIdx) => navigate('lesson', mIdx, lIdx)

View File

@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import React, { useState, useEffect } from 'react'
import Markdown from './Markdown'
import CodeBlock from './CodeBlock'
@@ -25,6 +25,10 @@ export default function LessonView({
}) {
const [activeTab, setActiveTab] = useState('theory')
useEffect(() => {
window.scrollTo({ top: 0, behavior: 'instant' })
}, [lesson.id])
const tabs = [
{ key: 'theory', icon: '📖', label: labels.theory, disabled: false },
{ key: 'code', icon: '💻', label: labels.code, disabled: !lesson.codeBlocks?.length },