File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { VisuallyHidden , Text } from '@chakra-ui/react' ;
2+ import { link } from 'joi' ;
3+ import Link from 'next/link' ;
4+ import { useEffect , useRef } from 'react' ;
5+ import { ROUTING } from '~/lib/constant' ;
6+
7+ export default function A11Y ( ) {
8+ const ref = useRef < HTMLDivElement > ( null ) ;
9+
10+ useEffect ( ( ) => {
11+ if ( ref . current ) ref . current . focus ( ) ;
12+ } , [ ref ] ) ;
13+
14+ return (
15+ < VisuallyHidden >
16+ < div ref = { ref } tabIndex = { - 1 } aria-live = "polite" aria-atomic = "true" >
17+ < Text as = "h2" fontSize = "lg" >
18+ LGU timetable Navigation
19+ </ Text >
20+ < p > A non-official blazingly fast website to access the LGU timetable.</ p >
21+ < nav aria-label = "move through the LGU timetable navigation" >
22+ { [
23+ { name : 'Student Timetable' , link : ROUTING . timetable } ,
24+ { name : 'Teachers Timetable' , link : ROUTING . teachers } ,
25+ { name : 'Fee Rooms' , link : ROUTING . free_class_rooms }
26+ ] . map ( ( item , idx ) => (
27+ < Link key = { idx } href = { item . link } >
28+ < Text > { item . name } </ Text >
29+ </ Link >
30+ ) ) }
31+ </ nav >
32+ </ div >
33+ </ VisuallyHidden >
34+ ) ;
35+ }
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ function Selection({ metaData }: { metaData: any }): JSX.Element {
122122 </ Text >
123123
124124 < TabStyle . Tabs index = { currTabIdx } onChange = { setCurrTabIdx } >
125- < TabStyle . TabList >
125+ < TabStyle . TabList autoFocus = { true } >
126126 < TabStyle . Tab > Semester</ TabStyle . Tab >
127127 < TabStyle . Tab isDisabled = { userInput . fall == null } > Program</ TabStyle . Tab >
128128 < TabStyle . Tab isDisabled = { userInput . semester == null } > Section</ TabStyle . Tab >
@@ -133,6 +133,7 @@ function Selection({ metaData }: { metaData: any }): JSX.Element {
133133 < TabStyle . TabPanel textAlign = { 'center' } >
134134 < DropDown
135135 defautlSelectedItem = { 'choose semester' }
136+ useInitialFocus = { true }
136137 menuItems = { Object . keys ( metaData ) }
137138 onClick = { (
138139 selectedItem : string ,
Original file line number Diff line number Diff line change @@ -70,18 +70,18 @@ export const GITHUB_REPOS = [
7070
7171export const ROUTING = {
7272 home : '/' ,
73- developer : '/developer' ,
74- contribute : '/contribute' ,
75- profile : '/profile' ,
7673 timetable : '/timetable' ,
77- discussions : '/discussions' ,
78- free_class_rooms : '/freeclassrooms' ,
79- admin : '/admin' ,
8074 teachers : '/timetable/teachers' ,
8175 rooms : '/timetable/rooms' ,
82- clash_resolver : '/util/timetable_clashresolver ' ,
76+ free_class_rooms : '/freeclassrooms ' ,
8377 room_activities : '/room-activities' ,
78+ clash_resolver : '/util/timetable_clashresolver' ,
8479 past_papers : '/pastpaper' ,
80+ developer : '/developer' ,
81+ contribute : '/contribute' ,
82+ profile : '/profile' ,
83+ discussions : '/discussions' ,
84+ admin : '/admin' ,
8585 blogs : '/blogs'
8686} ;
8787
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { SocialLinks } from '~/components/seo/Seo';
66import MainAnimator from '~/components/design/MainAnimator' ;
77import FrontPageAd from '~/components/Ads/FrontPageAd' ;
88import StructuredData from '~/components/StructuredData' ;
9+ import A11Y from '~/components/A11Y' ;
910
1011export default function Home ( ) {
1112 useFirebaseAnalyticsReport ( FIREBASE_ANALYTICS_EVENTS . home_page ) ;
@@ -30,6 +31,7 @@ export default function Home() {
3031 < SocialLinks />
3132 </ Head >
3233 < MainAnimator isDisabled >
34+ < A11Y />
3335 < div className = { 'roboto' } >
3436 < Hero renderDescription = { true } />
3537 < FrontPageAd />
You can’t perform that action at this time.
0 commit comments