mirror of
https://github.com/INFTF/xahau-course.git
synced 2026-04-29 14:57:42 +00:00
Fixing mobile issue
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user