-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,69 +2,41 @@ | |
|
||
import { useState } from 'react'; | ||
import HomePage from '@/components/HomePage'; | ||
import Dashboard from '@/components/Dashboard'; | ||
import { Button } from "@/components/ui/button"; | ||
import { Card, CardContent, CardHeader } from "@/components/ui/card"; | ||
import Link from 'next/link'; | ||
import AttendanceTracker from '@/components/AttendanceTracker'; // Import the existing component | ||
|
||
export default function Home() { | ||
const [showDashboard, setShowDashboard] = useState(false); | ||
const [activeTab, setActiveTab] = useState("home"); | ||
const [showAttendanceTracker, setShowAttendanceTracker] = useState(false); | ||
|
||
const webPages = [ | ||
{ name: "Uni-Notes", url: "https://uni-notes.netlify.app/" }, | ||
{ name: "ERP", url: "https://erp.bits-pilani.ac.in" }, | ||
{ name: "Google DSC Resources", url: "https://gdscbpdc.github.io/"}, | ||
{ name: "ACM Resources", url: "https://openlib-cs.acmbpdc.org/"} | ||
// Add other web pages as needed | ||
]; | ||
const renderNavigation = () => ( | ||
<nav className="flex items-center justify-between p-4"> | ||
<div className="font-bold text-xl">UniDash</div> | ||
<div className="flex items-center space-x-4"> | ||
<a href="[email protected]" className="hover:underline">Contact</a> | ||
<Link href="/about" className="hover:underline">About</Link> | ||
<button onClick={() => setShowAttendanceTracker(true)} className="hover:underline">Attendance Tracker</button> | ||
<Link href="/code" className="text-gray-500 hover:underline">Code</Link> | ||
<Button variant="default" className="bg-black text-white px-4 py-2 rounded-md">Join Up</Button> | ||
</div> | ||
</nav> | ||
); | ||
|
||
if (showAttendanceTracker) { | ||
return <AttendanceTracker onBack={() => setShowAttendanceTracker(false)} />; | ||
} | ||
|
||
if (!showDashboard) { | ||
return <HomePage onEnter={() => setShowDashboard(true)} />; | ||
return ( | ||
<HomePage | ||
onEnter={() => setShowDashboard(true)} | ||
navigation={renderNavigation()} | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="min-h-screen w-full bg-gray-100 p-2 sm:p-4 md:p-6"> | ||
<Card className="overflow-hidden rounded-xl border border-gray-200 bg-white shadow-lg mb-6"> | ||
<CardHeader className="border-b border-gray-200 bg-gray-50 p-4"> | ||
<div className="flex items-center justify-between"> | ||
<h2 className="text-xl font-bold">University Dashboard</h2> | ||
<div className="flex space-x-2"> | ||
<Button | ||
variant={activeTab === "home" ? "default" : "outline"} | ||
onClick={() => setActiveTab("home")} | ||
> | ||
Home | ||
</Button> | ||
<Button | ||
variant={activeTab === "features" ? "default" : "outline"} | ||
onClick={() => setActiveTab("features")} | ||
> | ||
Features | ||
</Button> | ||
</div> | ||
</div> | ||
</CardHeader> | ||
<CardContent className="p-2 sm:p-4"> | ||
{activeTab === "home" && ( | ||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4"> | ||
{webPages.map((page, index) => ( | ||
<div key={index} className="border rounded-lg p-4"> | ||
<h3 className="font-semibold mb-2">{page.name}</h3> | ||
<div className="h-[400px] sm:h-[500px] md:h-[600px]"> | ||
<iframe | ||
src={page.url} | ||
title={page.name} | ||
width="100%" | ||
height="100%" | ||
className="border-0" | ||
/> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
)} | ||
{activeTab === "features" && <div>Features content here</div>} | ||
</CardContent> | ||
</Card> | ||
</div> | ||
); | ||
return <Dashboard />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
|
||
const webPages = [ | ||
{ title: 'BITS ERP', url: 'https://erp.bits-pilani.ac.in/', description: 'The main website for registration, academic progress, and grading' }, | ||
{ title: 'LMS', url: 'https://lms.bitspilanidubai.ae/', description: 'A website for coursework management, assessments, and coursework resources' }, | ||
{ title: 'Uni Notes', url: 'https://uni-notes.netlify.app/', description: 'Find information across courses and their respective notes, contributed by individual students' }, | ||
{ title: 'Google DSC Resources', url: 'https://gdscbpdc.github.io/', description: 'Find information of technical workshops and events conducted by Google DSC BPDC' }, | ||
{ title: 'ACM lib Resources', url: 'https://openlib-cs.acmbpdc.org/', description: 'A library of resources provided by ACM BPDC' }, | ||
]; | ||
|
||
function Dashboard() { | ||
return ( | ||
<div className="container mx-auto p-4"> | ||
<h1 className="text-2xl font-bold mb-4">All Web Pages</h1> | ||
<div className="space-y-6"> | ||
{webPages.map((page, index) => ( | ||
<div key={index} className="border rounded-lg p-4 shadow-sm"> | ||
<h2 className="font-semibold mb-2">{page.title}</h2> | ||
<p className="text-sm mb-2">{page.description}</p> | ||
<div className="w-full h-[600px]"> | ||
<iframe | ||
src={page.url} | ||
className="w-full h-full border rounded" | ||
title={page.title} | ||
loading="lazy" | ||
/> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Dashboard; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters