This repository was archived by the owner on Aug 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " timetabl-app" ,
3- "version" : " 1.0.8 -beta" ,
3+ "version" : " 1.0.9 -beta" ,
44 "description" : " " ,
55 "main" : " index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ import { Period } from "../Period";
88export const DTTPeriod = ( {
99 period,
1010 isLoaded,
11- date ,
11+ active ,
1212} : {
1313 period : TimetablPeriod ;
1414 isLoaded : boolean ;
15- date ?: string ;
15+ active : boolean ;
1616} ) => {
1717 const {
1818 showTimesInsteadOfRooms,
@@ -28,11 +28,7 @@ export const DTTPeriod = ({
2828
2929 return (
3030 < Period
31- active = {
32- ( DateTime . fromISO ( `${ date } T${ period . time } ` ) < DateTime . now ( ) &&
33- DateTime . now ( ) < DateTime . fromISO ( `${ date } T${ period . endTime } ` ) ) ??
34- false
35- }
31+ active = { active }
3632 colour = {
3733 period . room &&
3834 {
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ const HomeView = ({
6262
6363 const [ countdown , setCountdown ] = useState ( "" ) ;
6464
65+ const activeIndex = periods . findIndex (
66+ ( { time, endTime } : { time : string ; endTime : string } ) =>
67+ ( DateTime . fromISO ( `${ date } T${ time } ` ) < DateTime . now ( ) &&
68+ DateTime . now ( ) < DateTime . fromISO ( `${ date } T${ endTime } ` ) ) ??
69+ false
70+ ) ;
71+
6572 return (
6673 < LayoutGroup >
6774 < Flex direction = { "column" } align = "center" gap = { 1.5 } >
@@ -129,6 +136,7 @@ const HomeView = ({
129136 { periods . length ? (
130137 periods . map ( ( period , index ) => (
131138 < DTTPeriod
139+ active = { activeIndex === index }
132140 period = { period }
133141 key = { period . key ?? index + 100 }
134142 isLoaded = { isLoaded }
You can’t perform that action at this time.
0 commit comments