Skip to content

Commit e5930e5

Browse files
committed
fix(floor&bus):now the bus and floor opne the pdf
1 parent 223c028 commit e5930e5

9 files changed

Lines changed: 105 additions & 59 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev --turbopack",
6+
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
99
"test": "jest",

public/sw.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/api/og/route.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/app/attendance/calendar/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ export default function AttendanceCalendarAllSubjects() {
179179
</header>
180180

181181
<div className="grid grid-cols-7 gap-2 text-xs font-bold mb-1 select-none">
182-
{["S", "M", "T", "W", "T", "F", "S"].map((d) => (
183-
<div key={d} className="uppercase text-center">
182+
{["S", "M", "T", "W", "T", "F", "S"].map((d, i) => (
183+
<div key={`${d}-${i}`} className="uppercase text-center">
184184
{d}
185185
</div>
186186
))}

src/app/bus/page.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
//import { BusButtons } from "@/components/Bus/busButton";
1+
"use client";
22
import { busData } from "@/data/bus";
33

4-
5-
64
const BusPage: React.FC = () => {
75
return (
86
<div className="min-h-screen bg-white">
@@ -33,7 +31,12 @@ const BusPage: React.FC = () => {
3331
// Use BusButtons
3432
<button
3533
key={index}
36-
className="bg-white border border-black rounded-lg py-7 text-center shadow-md"
34+
className="bg-white border border-black rounded-lg py-7 text-center shadow-md hover:shadow-lg transition cursor-pointer"
35+
onClick={() => {
36+
if ((bus as any).pdfUrl) {
37+
window.open((bus as any).pdfUrl as string, "_blank", "noopener,noreferrer");
38+
}
39+
}}
3740
>
3841
<span className="text-2xl font-bold text-black">{bus.name}</span>
3942
</button>

src/app/floor/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"use client";
12
import { floors } from "@/data/floor";
23

34
const BusPage: React.FC = () => {
@@ -30,7 +31,12 @@ const BusPage: React.FC = () => {
3031
// Use BusButtons
3132
<button
3233
key={index}
33-
className="bg-white border border-black rounded-lg py-7 text-center shadow-md"
34+
className="bg-white border border-black rounded-lg py-7 text-center shadow-md hover:shadow-lg transition cursor-pointer"
35+
onClick={() => {
36+
if ((floor as any).pdfUrl) {
37+
window.open((floor as any).pdfUrl as string, "_blank", "noopener,noreferrer");
38+
}
39+
}}
3440
>
3541
<span className="text-2xl font-bold text-black">{floor.name}</span>
3642
</button>

src/data/bus.ts

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
1-
export const busData = [
2-
{ slug: 'bus-1', name: 'Bus 1' },
3-
{ slug: 'bus-2', name: 'Bus 2' },
4-
{ slug: 'bus-3', name: 'Bus 3' },
5-
{ slug: 'bus-4', name: 'Bus 4' },
6-
{ slug: 'bus-5', name: 'Bus 5' },
7-
{ slug: 'bus-6', name: 'Bus 6' },
1+
export type BusItem = {
2+
slug: string;
3+
name: string;
4+
pdfUrl?: string; // optional placeholder PDF
5+
};
6+
7+
export const busData: BusItem[] = [
8+
{
9+
slug: 'bus-1',
10+
name: 'Bus 1',
11+
// Placeholder PDF; replace with /pdfs/bus-1.pdf in public/ when ready
12+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
13+
},
14+
{
15+
slug: 'bus-2',
16+
name: 'Bus 2',
17+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
18+
},
19+
{
20+
slug: 'bus-3',
21+
name: 'Bus 3',
22+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
23+
},
24+
{
25+
slug: 'bus-4',
26+
name: 'Bus 4',
27+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
28+
},
29+
{
30+
slug: 'bus-5',
31+
name: 'Bus 5',
32+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
33+
},
34+
{
35+
slug: 'bus-6',
36+
name: 'Bus 6',
37+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
38+
},
839
];

src/data/floor.ts

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,49 @@
1-
export const floors = [
2-
{ slug: 'Floor-1', name: 'Floor 1' },
3-
{ slug: 'Ground Floor', name: 'Ground Floor' },
4-
{ slug: 'Floor-2', name: 'Floor 2' },
5-
{ slug: 'Floor-3', name: 'Floor-3' },
6-
{ slug: 'Floor-4', name: 'Floor 4' },
1+
export type FloorItem = {
2+
slug: string;
3+
name: string;
4+
pdfUrl?: string; // optional placeholder PDF
5+
};
6+
7+
export const floors: FloorItem[] = [
8+
{
9+
slug: 'Ground Floor',
10+
name: 'Ground Floor',
11+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
12+
},
13+
{
14+
slug: 'Floor-1',
15+
name: 'Floor 1',
16+
// Placeholder PDF; replace with /pdfs/floor-1.pdf in public/ when ready
17+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
18+
},
19+
{
20+
slug: 'Floor-2',
21+
name: 'Floor 2',
22+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
23+
},
24+
{
25+
slug: 'Floor-3',
26+
name: 'Floor 3',
27+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
28+
},
29+
{
30+
slug: 'Floor-4',
31+
name: 'Floor 4',
32+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
33+
},
34+
{
35+
slug: 'Floor-5',
36+
name: 'Floor 5',
37+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
38+
},
39+
{
40+
slug: 'Floor-6',
41+
name: 'Floor 6',
42+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
43+
},
44+
{
45+
slug: 'Floor-7',
46+
name: 'Floor 7',
47+
pdfUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf',
48+
},
749
];

src/data/home/quickActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type QuickAction =
66
export const quickActions: QuickAction[] = [
77
{ text: "College Login", type: "external", url: "https://gecskp.etlab.in/user/login" },
88
{ text: "Bus Time", type: "route", path: "/bus" },
9-
{ text: "Attendance", type: "route", path: "/attendance" },
9+
{ text: "Project Showcase", type: "alert", message: "Project Collobaration feature coming soon!" },
1010
{ text: "Lost & Found", type: "route", path: "/lost" },
1111
{ text: "SGPA Calculator", type: "external", url: "https://ktugpa.web.app/" },
1212
{ text: "Hackathon", type: "external", url: "https://devpost.com/hackathons" },

0 commit comments

Comments
 (0)