Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { StorybookConfig } from "@storybook/nextjs";

const config: StorybookConfig = {
stories: ["../src/stories/**/*.stories.@(js|jsx|ts|tsx)"], // 👈 Update this path!
addons: ["@storybook/addon-essentials"],
framework: "@storybook/nextjs",
};

export default config;
11 changes: 11 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import "../src/styles/globals.css";
import { Preview } from "@storybook/react";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: { expanded: true },
},
};

export default preview;
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"storybook": "storybook dev -p 6006",
"postbuild": "next-sitemap"
},
"dependencies": {
Expand Down Expand Up @@ -41,6 +42,11 @@
"@radix-ui/react-tooltip": "^1.1.4",
"@supabase/supabase-js": "^2.49.1",
"@tanstack/react-query": "^5.56.2",
"@tiptap/extension-placeholder": "2.2.4",
"@tiptap/extension-typography": "2.2.4",
"@tiptap/pm": "^2.11.5",
"@tiptap/react": "2.2.4",
"@tiptap/starter-kit": "2.2.4",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",
Expand Down Expand Up @@ -74,6 +80,11 @@
"devDependencies": {
"@eslint/eslintrc": "^3",
"@eslint/js": "^9.9.0",
"@storybook/addon-essentials": "^8.6.4",
"@storybook/addons": "^7.6.17",
"@storybook/cli": "^8.6.4",
"@storybook/nextjs": "^8.6.4",
"@storybook/react": "^8.6.4",
"@tailwindcss/typography": "^0.5.16",
"@types/node": "^20",
"@types/react": "18",
Expand Down
27 changes: 18 additions & 9 deletions public/sitemap-0.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://roboticspec.com</loc><lastmod>2025-03-11T05:42:23.773Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/activities</loc><lastmod>2025-03-11T05:42:23.774Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin</loc><lastmod>2025-03-11T05:42:23.774Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/page</loc><lastmod>2025-03-11T05:42:23.774Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/contact</loc><lastmod>2025-03-11T05:42:23.774Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/events</loc><lastmod>2025-03-11T05:42:23.774Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/events/components/EventCalendar</loc><lastmod>2025-03-11T05:42:23.774Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/project</loc><lastmod>2025-03-11T05:42:23.774Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/project/components/ProjectCard</loc><lastmod>2025-03-11T05:42:23.774Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com</loc><lastmod>2025-03-11T19:53:13.436Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/activities</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/ActivitiesEditor</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/BubbleMenu</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/EventsEditor</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/FormatButton</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/HeroEditor</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/MarkdownEditor</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/MenuBar</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/ProjectsEditor</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/components/TeamEditor</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/admin/page</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/contact</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/events</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/events/components/EventCalendar</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/project</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://roboticspec.com/project/components/ProjectCard</loc><lastmod>2025-03-11T19:53:13.437Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
233 changes: 117 additions & 116 deletions src/components/Admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
import { useToast } from "@/hooks/use-toast";
import Link from "next/link";
import { Home, FileText, Calendar, Users, ExternalLink } from "lucide-react";
import HeroEditor from "@/components/admin/HeroEditor";
import ProjectsEditor from "@/components/admin/ProjectsEditor";
import ActivitiesEditor from "@/components/admin/ActivitiesEditor";
import EventsEditor from "@/components/admin/EventsEditor";
import TeamEditor from "@/components/admin/TeamEditor";
import HeroEditor from "@/pages/admin/components/HeroEditor";
import ProjectsEditor from "@/pages/admin/components/ProjectsEditor";
import ActivitiesEditor from "@/pages/admin/components/ActivitiesEditor";
import EventsEditor from "@/pages/admin/components/EventsEditor";
import TeamEditor from "@/pages/admin/components/TeamEditor";
import PageLayout from "./layout/PageLayout";
import PageHead from "./layout/PageHead";
import PageSection from "./layout/PageSection";

const Admin = () => {
const { toast } = useToast();
Expand All @@ -24,128 +25,128 @@ const Admin = () => {
title="Robotics Society | Punjab Engineering College"
description='PEC Robotics Society at Punjab Engineering College is dedicated to innovation in robotics and automation. Explore our projects and join our team.'
/>
<div className="min-h-screen bg-white p-6">
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6 }}
className="max-w-6xl mx-auto"
<section className="py-24" id="events">
<PageSection
title='Admin Dashboard'
subtitle='Manage website content'
>
<div className="flex flex-row justify-between items-center mb-8">
<div>
<h1 className="text-4xl font-bold">Admin Dashboard</h1>
<p className="text-gray-600 mt-2">Manage website content</p>
</div>
<div className="min-h-screen bg-white p-6">
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.6 }}
className="max-w-6xl mx-auto"
>

</div>

<Tabs defaultValue="hero" value={activeTab} onValueChange={setActiveTab} className="w-full mb-12">
<div className="overflow-x-auto pb-2">
<TabsList className="mb-8">
<TabsTrigger value="hero" className="flex items-center gap-2">
<Home className="h-4 w-4" /> Hero Section
</TabsTrigger>
<TabsTrigger value="projects" className="flex items-center gap-2">
<FileText className="h-4 w-4" /> Projects
</TabsTrigger>
<TabsTrigger value="activities" className="flex items-center gap-2">
<FileText className="h-4 w-4" /> Activities
</TabsTrigger>
<TabsTrigger value="events" className="flex items-center gap-2">
<Calendar className="h-4 w-4" /> Events
</TabsTrigger>
<TabsTrigger value="team" className="flex items-center gap-2">
<Users className="h-4 w-4" /> Team
</TabsTrigger>
</TabsList>
</div>
<Tabs defaultValue="hero" value={activeTab} onValueChange={setActiveTab} className="w-full mb-12">
<div className="overflow-x-auto pb-2">
<TabsList className="mb-8">
<TabsTrigger value="hero" className="flex items-center gap-2">
<Home className="h-4 w-4" /> Hero Section
</TabsTrigger>
<TabsTrigger value="projects" className="flex items-center gap-2">
<FileText className="h-4 w-4" /> Projects
</TabsTrigger>
<TabsTrigger value="activities" className="flex items-center gap-2">
<FileText className="h-4 w-4" /> Activities
</TabsTrigger>
<TabsTrigger value="events" className="flex items-center gap-2">
<Calendar className="h-4 w-4" /> Events
</TabsTrigger>
<TabsTrigger value="team" className="flex items-center gap-2">
<Users className="h-4 w-4" /> Team
</TabsTrigger>
</TabsList>
</div>

<Card className="shadow-md">
<CardHeader>
<CardTitle>
{activeTab === "hero" && "Hero Section Editor"}
{activeTab === "projects" && "Projects Editor"}
{activeTab === "activities" && "Activities Editor"}
{activeTab === "events" && "Events Editor"}
{activeTab === "team" && "Team Members Editor"}
</CardTitle>
<CardDescription>
{activeTab === "hero" && "Edit the main heading, text and background images"}
{activeTab === "projects" && "Add, edit or remove projects"}
{activeTab === "activities" && "Manage robotics activities and workshops"}
{activeTab === "events" && "Add or edit upcoming events and competitions"}
{activeTab === "team" && "Manage team members and their information"}
</CardDescription>
</CardHeader>
<CardContent>
<TabsContent value="hero" className="mt-0">
<HeroEditor />
</TabsContent>
<Card className="shadow-md">
<CardHeader>
<CardTitle>
{activeTab === "hero" && "Hero Section Editor"}
{activeTab === "projects" && "Projects Editor"}
{activeTab === "activities" && "Activities Editor"}
{activeTab === "events" && "Events Editor"}
{activeTab === "team" && "Team Members Editor"}
</CardTitle>
<CardDescription>
{activeTab === "hero" && "Edit the main heading, text and background images"}
{activeTab === "projects" && "Add, edit or remove projects"}
{activeTab === "activities" && "Manage robotics activities and workshops"}
{activeTab === "events" && "Add or edit upcoming events and competitions"}
{activeTab === "team" && "Manage team members and their information"}
</CardDescription>
</CardHeader>
<CardContent>
<TabsContent value="hero" className="mt-0">
<HeroEditor />
</TabsContent>

<TabsContent value="projects" className="mt-0">
<ProjectsEditor />
</TabsContent>
<TabsContent value="projects" className="mt-0">
<ProjectsEditor />
</TabsContent>

<TabsContent value="activities" className="mt-0">
<ActivitiesEditor />
</TabsContent>
<TabsContent value="activities" className="mt-0">
<ActivitiesEditor />
</TabsContent>

<TabsContent value="events" className="mt-0">
<EventsEditor />
</TabsContent>
<TabsContent value="events" className="mt-0">
<EventsEditor />
</TabsContent>

<TabsContent value="team" className="mt-0">
<TeamEditor />
</TabsContent>
</CardContent>
</Card>
</Tabs>
<TabsContent value="team" className="mt-0">
<TeamEditor />
</TabsContent>
</CardContent>
</Card>
</Tabs>

<div className="mt-8">
<h2 className="text-xl font-semibold mb-4">Preview Pages</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Card className="hover:shadow-md transition-shadow">
<CardContent className="p-6">
<h3 className="text-lg font-medium mb-2">Activities Page</h3>
<p className="text-gray-600 text-sm mb-4">View all robotics activities and workshops.</p>
<Button asChild variant="outline" className="w-full">
<Link href="/activities" target="_blank">
<ExternalLink className="h-4 w-4 mr-2" />
View Page
</Link>
</Button>
</CardContent>
</Card>
<div className="mt-8">
<h2 className="text-xl font-semibold mb-4">Preview Pages</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Card className="hover:shadow-md transition-shadow">
<CardContent className="p-6">
<h3 className="text-lg font-medium mb-2">Activities Page</h3>
<p className="text-gray-600 text-sm mb-4">View all robotics activities and workshops.</p>
<Button asChild variant="outline" className="w-full">
<Link href="/activities" target="_blank">
<ExternalLink className="h-4 w-4 mr-2" />
View Page
</Link>
</Button>
</CardContent>
</Card>

<Card className="hover:shadow-md transition-shadow">
<CardContent className="p-6">
<h3 className="text-lg font-medium mb-2">Events Page</h3>
<p className="text-gray-600 text-sm mb-4">View upcoming events and competitions.</p>
<Button asChild variant="outline" className="w-full">
<Link href="/events" target="_blank">
<ExternalLink className="h-4 w-4 mr-2" />
View Page
</Link>
</Button>
</CardContent>
</Card>
<Card className="hover:shadow-md transition-shadow">
<CardContent className="p-6">
<h3 className="text-lg font-medium mb-2">Events Page</h3>
<p className="text-gray-600 text-sm mb-4">View upcoming events and competitions.</p>
<Button asChild variant="outline" className="w-full">
<Link href="/events" target="_blank">
<ExternalLink className="h-4 w-4 mr-2" />
View Page
</Link>
</Button>
</CardContent>
</Card>

<Card className="hover:shadow-md transition-shadow">
<CardContent className="p-6">
<h3 className="text-lg font-medium mb-2">Team Page</h3>
<p className="text-gray-600 text-sm mb-4">View all team members and their profiles.</p>
<Button asChild variant="outline" className="w-full">
<Link href="/team" target="_blank">
<ExternalLink className="h-4 w-4 mr-2" />
View Page
</Link>
</Button>
</CardContent>
</Card>
</div>
<Card className="hover:shadow-md transition-shadow">
<CardContent className="p-6">
<h3 className="text-lg font-medium mb-2">Team Page</h3>
<p className="text-gray-600 text-sm mb-4">View all team members and their profiles.</p>
<Button asChild variant="outline" className="w-full">
<Link href="/team" target="_blank">
<ExternalLink className="h-4 w-4 mr-2" />
View Page
</Link>
</Button>
</CardContent>
</Card>
</div>
</div>
</motion.div>
</div>
</motion.div>
</div>
</PageSection>
</section>
</PageLayout >
);
};
Expand Down
3 changes: 1 addition & 2 deletions src/components/FormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Label } from './ui/label'
import { Input } from './ui/input'
import { FormFieldProps } from '@/types'
import MarkdownEditor from './admin/MarkdownEditor'
import MarkdownEditor from '../pages/admin/components/MarkdownEditor'
import Blob from './Blob'

const FormField = ({ htmlFor, title, id, onChange, placeholder, value, type, setFileName }: FormFieldProps) => {
Expand Down Expand Up @@ -38,7 +38,6 @@ const FormField = ({ htmlFor, title, id, onChange, placeholder, value, type, set
value={value}
onChange={(value) => onChange((prev: any) => ({ ...prev, [id]: value }))}
placeholder={placeholder}
minHeight="200px"
/>
</div>
)
Expand Down
Loading
Loading