ALIVE! make it work and navigation now dynamic

This commit is contained in:
kilyabin
2025-11-18 03:15:23 +04:00
parent 642649e240
commit 5feff78420
10 changed files with 11361 additions and 31 deletions

View File

@@ -8,6 +8,7 @@ import { useRouter } from 'next/router'
import { FaGithub } from 'react-icons/fa'
import cx from 'classnames'
import { NavContext, NavContextProvider } from '@/shared/context/nav-context'
import { groups } from '@/shared/data/groups'
export function NavBar({ cacheAvailableFor }: {
cacheAvailableFor: string[]
@@ -44,8 +45,9 @@ export function NavBar({ cacheAvailableFor }: {
<header className="sticky top-0 w-full p-2 bg-background z-[1] pb-0 mb-2 shadow-header">
<nav className={cx('rounded-lg p-2 w-full flex justify-between', { 'bg-slate-200': theme === 'light', 'bg-slate-900': theme === 'dark' })} ref={navRef}>
<ul className="flex gap-2">
<NavBarItem url="/ps7">ПС-7</NavBarItem>
<NavBarItem url="/pks35k">ПКС-35к</NavBarItem>
{Object.entries(groups).map(([id, [, name]]) => (
<NavBarItem key={id} url={`/${id}`}>{name}</NavBarItem>
))}
<AddGroupButton />
</ul>
<div className='flex gap-1 min-[500px]:gap-2'>

View File

@@ -14,7 +14,7 @@ export function Day({ day }: {
'Пятница',
'Суббота',
'Воскресенье'
][day.date.getDay()-1]
][(day.date.getDay() + 6) % 7]
const longNames = day.lessons
.some(lesson => 'subject' in lesson && lesson.subject.length > 20)

View File

@@ -86,6 +86,11 @@ export function Lesson({ lesson, width = 350 }: {
{lesson.time.start} - {lesson.time.end}{
}{lesson.time.hint && <span className='font-bold'>&nbsp;({lesson.time.hint})</span>}
</CardDescription>
{hasTeacher && lesson.teacher && (
<CardDescription className='text-sm font-medium'>
{lesson.teacher}
</CardDescription>
)}
</div>
</div>
</CardHeader>