fix(schedule): hide empty days and lessons, update design and fonts

This commit is contained in:
kilyabin
2026-03-05 12:32:48 +04:00
parent e6ba2e0334
commit a6da1129c9
2 changed files with 8 additions and 26 deletions

View File

@@ -53,31 +53,7 @@ export default function TeacherPage(props: NextSerialized<PageProps>) {
if ('scrollRestoration' in history) {
history.scrollRestoration = 'auto'
}
let attempts = 0
const MAX_ATTEMPTS = 50 // Максимум 5 секунд (50 * 100ms)
const interval = setInterval(() => {
attempts++
const today = getDayOfWeek(new Date())
const todayBlock = document.getElementById(today)
if (todayBlock) {
const GAP = 48
const HEADER_HEIGHT = 64
window.scrollTo({ top: todayBlock.offsetTop - GAP - HEADER_HEIGHT, behavior: 'smooth' })
clearInterval(interval)
} else if (attempts >= MAX_ATTEMPTS) {
// Прекращаем попытки после максимального количества
clearInterval(interval)
}
}, 100)
// Cleanup функция для очистки интервала при размонтировании
return () => {
clearInterval(interval)
}
}, [schedule, error])
}, [error])
return (
<>