Skip to content

Commit 7346380

Browse files
committed
gym details
1 parent d2ee11e commit 7346380

File tree

3 files changed

+194
-62
lines changed

3 files changed

+194
-62
lines changed

public/json/students/hostels.json

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"desc": "Infosys Foundation Girls Hostel is exclusively constructed for accommodating girls. The location of the hostel is just behind the main gate of the institute. This 4-storeyed residence contains 125 rooms and totally can be accommodated with 250 students. This hostel is fully equipped with basic amenities such as 24/7 purified water supply, and uninterrupted Power supply to create an ambient environment. In this residency, each room is equipped with two LAN ports and a high-speed Wi-Fi facility. Table Tennis Court is located inside the residency and other sports items are also available for recreation. The residency provides a gym facility to ensure the physical fitness of the students.",
1717
"Warden": "Dr. T. Sugirtha",
1818
"RoomNo": "2167",
19-
"Department": "Department of Computer Science and Engineering,Indian Institute of Information Technology,Tiruchirappalli-620012.",
19+
"Department": "Department of Computer Science and Engineering, Indian Institute of Information Technology, Tiruchirappalli-620012.",
2020
"emailId": "dcwg@iiitt.ac.in",
2121
"WardenImage": "/faculty/Sugirtha.jpg"
2222
}
@@ -26,17 +26,39 @@
2626
"title": "Smt. Savithribai Phule Dining Hall",
2727
"Hostelsrc": "/hostel/IIITT_Mess.jpg",
2828
"desc": "Smt. Savithribai Phule Dining Hall can serve food simultaneously for about 300 students. High quality and healthy foods are being provided to the students in a hygienic environment.",
29-
"Warden": "Dr Banoth Ravi",
30-
"RoomNo": "2065",
31-
"Department": "Department of Electronics and Communication Engineering,Indian Institute of Information Technology,Tiruchirappalli-620012.",
29+
"Warden": "Dr. M. Harish Adhithya",
30+
"RoomNo": "",
31+
"Department": "Department of Electronics and Communication Engineering, Indian Institute of Information Technology, Tiruchirappalli-620012.",
3232
"emailId": "messwarden@iiitt.ac.in",
33-
"WardenImage": "/faculty/raviB_2024.jpeg",
33+
"WardenImage": "/faculty/HarishAdhithyaM.JPG",
3434
"MessTimings": {
3535
"Breakfast": "7.00 am to 9.00 am",
3636
"Lunch": "12.30 pm to 2.00 pm",
3737
"Snacks": "4.30 pm to 5.30 pm",
3838
"Dinner": "7.00 pm to 9.00 pm"
3939
}
4040
}
41+
],
42+
"Gym": [
43+
{
44+
"title": "Smt. Savithribai Phule Dining Hall",
45+
"Hostelsrc": "/hostel/IIITT_Mess.jpg",
46+
"desc": "Our college hostel gym is a well-equipped fitness facility designed to promote a healthy and active lifestyle among students. It provides a safe and convenient space for daily workouts, helping students relieve stress and maintain physical well-being alongside their academic routine",
47+
"Warden": "Dr. D Suresh",
48+
"RoomNo": "",
49+
"Department": "Department of Electronics and Communication Engineering, Indian Institute of Information Technology, Tiruchirappalli-620012.",
50+
"emailId": "sureshd@iiitt.ac.in",
51+
"WardenImage": "/faculty/SureshD.jpg",
52+
"GymTimings": {
53+
"Morning": "5:30 am to 7:30 am",
54+
"Evening": "4:00 pm to 8:00 pm"
55+
},
56+
"forms": [
57+
{
58+
"title": "Gym Guidelines",
59+
"url": "gym_2026/Gym_Guidelines_IIIT%20Tiruchirappalli.pdf"
60+
}
61+
]
62+
}
4163
]
4264
}

src/app/hostel/page.tsx

Lines changed: 156 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,22 @@ import {
1818
CircularProgress,
1919
Typography,
2020
} from "@mui/material";
21-
import Grid from "@mui/material/Grid2"
21+
import Grid from "@mui/material/Grid2";
2222
import Image from "next/image";
2323
import { useCallback, useEffect, useState } from "react";
2424
import nextConfig from "../../../next.config";
2525
import styles from "./hostel.module.css";
2626
import PersonCard from "@/components/PersonCard/PersonCard";
2727
import TableComponent from "@/components/tablecomponent/tablecomponent";
28-
import {HostelData,MessData} from "@/types/hostel.types";
28+
import { GymData, HostelData, MessData } from "@/types/hostel.types";
29+
import FeedIcon from "@mui/icons-material/Feed";
2930

3031
export default function Hostel() {
3132
const [hostelInfo, setHostelInfo] = useState<HostelData[] | null>(null);
3233
const [forms, setForms] = useState<FormData[] | null>(null);
3334
const [loading, setLoading] = useState<boolean>(true);
3435
const [messInfo, setMessInfo] = useState<MessData[] | null>(null);
36+
const [gymInfo, setGymInfo] = useState<GymData[] | null>(null);
3537

3638
const fetchData = useCallback(async () => {
3739
setLoading(true);
@@ -45,6 +47,7 @@ export default function Hostel() {
4547
const hostelJson = await hostelRes.value.json();
4648
setHostelInfo(hostelJson.Hostel);
4749
setMessInfo(hostelJson.Mess);
50+
setGymInfo(hostelJson.Gym);
4851
}
4952

5053
if (formRes.status === "fulfilled") {
@@ -76,20 +79,22 @@ export default function Hostel() {
7679

7780
<Grid container spacing={3} className={styles.cardContainer}>
7881
{hostelInfo?.map((info, index) => (
79-
<Grid size={{xs:12, sm:10 ,md:6}} key={index} gap={2}>
80-
<Card sx={{
81-
height: "100%",
82-
display: "flex",
83-
flexDirection: "column",
84-
borderRadius: 2,
85-
boxShadow: 3,
86-
}}>
82+
<Grid size={{ xs: 12, sm: 10, md: 6 }} key={index} gap={2}>
83+
<Card
84+
sx={{
85+
height: "100%",
86+
display: "flex",
87+
flexDirection: "column",
88+
borderRadius: 2,
89+
boxShadow: 3,
90+
}}
91+
>
8792
<Image
8893
src={`${nextConfig.env?.DOCUMENT}${info.Hostelsrc}`}
8994
alt={info.title}
9095
width={680}
9196
height={462}
92-
style={{ width: "100%", height:"350" }}
97+
style={{ width: "100%", height: "350" }}
9398
/>
9499
<CardContent>
95100
<Typography variant="body2" color="text.secondary" mb={2}>
@@ -115,56 +120,151 @@ export default function Hostel() {
115120

116121
<div className={styles.sectiondivider}></div>
117122

118-
{/* Mess Hall Section */}
119-
<Typography variant="h2" className={styles.title}>
120-
Mess Hall
121-
</Typography>
123+
<Grid container spacing={4}>
124+
{/* Mess Hall Section */}
125+
<Grid size={{ xs: 12, md: 6 }}>
126+
<Typography variant="h2" className={styles.title}>
127+
Mess Hall
128+
</Typography>
122129

123-
<Grid container spacing={3} className={styles.cardContainer}>
124-
{messInfo?.map((mess, index) => (
125-
<Grid size={{xs:12, sm:10 ,md:6}} key={index}>
126-
<Card sx={{
127-
height: "100%",
128-
display: "flex",
129-
flexDirection: "column",
130-
borderRadius: 2,
131-
boxShadow: 3,
132-
}}>
133-
<Image
134-
src={`${nextConfig.env?.DOCUMENT}${mess.Hostelsrc}`}
135-
alt={mess.title}
136-
width={600}
137-
height={462}
138-
style={{ width: "100%", height:"auto" }}
139-
/>
140-
<CardContent>
141-
<Typography variant="body2" color="text.secondary" mb={2}>
142-
{mess.desc}
143-
</Typography>
130+
<Grid
131+
container
132+
spacing={3}
133+
alignItems="stretch"
134+
className={styles.cardContainer}
135+
>
136+
{messInfo?.map((mess, index) => (
137+
<Grid key={index} size={{ xs: 12 }} display="flex">
138+
<Card
139+
sx={{
140+
height: "100%",
141+
display: "flex",
142+
flexDirection: "column",
143+
borderRadius: 2,
144+
boxShadow: 3,
145+
}}
146+
>
147+
<Image
148+
src={`${nextConfig.env?.DOCUMENT}${mess.Hostelsrc}`}
149+
alt={mess.title}
150+
width={600}
151+
height={462}
152+
style={{ width: "100%", height: "auto" }}
153+
/>
144154

145-
<Box sx={{ display: "grid", gap: 1 }}>
146-
{Object.entries(mess.MessTimings).map(([meal, time]) => (
147-
<Typography key={meal} variant="body2">
148-
<strong>{meal}:</strong> {time}
155+
<CardContent sx={{ flexGrow: 1 }}>
156+
<Typography variant="body2" color="text.secondary" mb={2}>
157+
{mess.desc}
149158
</Typography>
150-
))}
151-
</Box>
152-
153-
<Box mt={2}>
154-
<PersonCard
155-
name={mess.Warden}
156-
src={mess.WardenImage}
157-
Room={mess.RoomNo}
158-
src_type="Warden"
159-
dept={mess.Department}
160-
emailID={mess.emailId}
161-
designation=""
159+
160+
<Box sx={{ display: "grid", gap: 1 }}>
161+
{Object.entries(mess.MessTimings).map(([meal, time]) => (
162+
<Typography key={meal} variant="body2">
163+
<strong>{meal}:</strong> {time}
164+
</Typography>
165+
))}
166+
</Box>
167+
168+
<Box mt="auto">
169+
<PersonCard
170+
name={mess.Warden}
171+
src={mess.WardenImage}
172+
src_type="Warden"
173+
dept={mess.Department}
174+
emailID={mess.emailId}
175+
designation=""
176+
/>
177+
</Box>
178+
</CardContent>
179+
</Card>
180+
</Grid>
181+
))}
182+
</Grid>
183+
</Grid>
184+
185+
{/* Gym Section */}
186+
<Grid size={{ xs: 12, md: 6 }}>
187+
<Typography variant="h2" className={styles.title}>
188+
Gym
189+
</Typography>
190+
191+
<Grid
192+
container
193+
spacing={3}
194+
alignItems="stretch"
195+
className={styles.cardContainer}
196+
>
197+
{gymInfo?.map((gym, index) => (
198+
<Grid key={index} size={{ xs: 12 }} display="flex">
199+
<Card
200+
sx={{
201+
height: "100%",
202+
display: "flex",
203+
flexDirection: "column",
204+
borderRadius: 2,
205+
boxShadow: 3,
206+
}}
207+
>
208+
<Image
209+
src={`${nextConfig.env?.DOCUMENT}${gym.Hostelsrc}`}
210+
alt={gym.title}
211+
width={600}
212+
height={462}
213+
style={{ width: "100%", height: "auto" }}
162214
/>
163-
</Box>
164-
</CardContent>
165-
</Card>
215+
216+
<CardContent sx={{ flexGrow: 1 }}>
217+
<Typography variant="body2" color="text.secondary" mb={2}>
218+
{gym.desc}
219+
</Typography>
220+
221+
<Box sx={{ display: "grid", gap: 1 }}>
222+
{Object.entries(gym.GymTimings).map(([day, time]) => (
223+
<Typography key={day} variant="body2">
224+
<strong>{day}:</strong> {time}
225+
</Typography>
226+
))}
227+
</Box>
228+
229+
<Box mt={2}>
230+
{gym.forms.map((form, i) => (
231+
<Box
232+
key={i}
233+
display="flex"
234+
alignItems="center"
235+
gap={1}
236+
mb={1}
237+
>
238+
<FeedIcon fontSize="small" />
239+
<Typography variant="body1">
240+
<a
241+
href={`${nextConfig.env?.DOCUMENT}/${form.url}`}
242+
target="_blank"
243+
rel="noopener noreferrer"
244+
>
245+
{form.title}
246+
</a>
247+
</Typography>
248+
</Box>
249+
))}
250+
</Box>
251+
252+
<Box mt="auto">
253+
<PersonCard
254+
name={gym.Warden}
255+
src={gym.WardenImage}
256+
src_type="Warden"
257+
dept={gym.Department}
258+
emailID={gym.emailId}
259+
designation=""
260+
/>
261+
</Box>
262+
</CardContent>
263+
</Card>
264+
</Grid>
265+
))}
166266
</Grid>
167-
))}
267+
</Grid>
168268
</Grid>
169269

170270
<div className={styles.sectiondivider}></div>

src/types/hostel.types.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export interface HostelData {
32
title: string;
43
desc: string;
@@ -18,3 +17,14 @@ export interface MessData extends HostelData {
1817
Dinner: string;
1918
};
2019
}
20+
21+
export interface GymData extends HostelData {
22+
GymTimings: {
23+
Morning: string;
24+
Evening: string;
25+
};
26+
forms: {
27+
title: string;
28+
url: string;
29+
}[];
30+
}

0 commit comments

Comments
 (0)