Skip to content

Commit 463588a

Browse files
committed
Updated : added categories to teams
1 parent 5d80d31 commit 463588a

9 files changed

Lines changed: 320 additions & 49 deletions

File tree

public/sitemap-0.xml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<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">
3-
<url><loc>https://roboticspec.com</loc><lastmod>2025-03-14T06:23:27.826Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4-
<url><loc>https://roboticspec.com/activities</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
5-
<url><loc>https://roboticspec.com/admin</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
6-
<url><loc>https://roboticspec.com/admin/components/ActivitiesEditor</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
7-
<url><loc>https://roboticspec.com/admin/components/BubbleMenu</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
8-
<url><loc>https://roboticspec.com/admin/components/EventsEditor</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
9-
<url><loc>https://roboticspec.com/admin/components/FormatButton</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
10-
<url><loc>https://roboticspec.com/admin/components/HeroEditor</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
11-
<url><loc>https://roboticspec.com/admin/components/MarkdownEditor</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
12-
<url><loc>https://roboticspec.com/admin/components/MenuBar</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
13-
<url><loc>https://roboticspec.com/admin/components/ProjectsEditor</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
14-
<url><loc>https://roboticspec.com/admin/components/TeamEditor</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
15-
<url><loc>https://roboticspec.com/admin/page</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
16-
<url><loc>https://roboticspec.com/contact</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
17-
<url><loc>https://roboticspec.com/events</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
18-
<url><loc>https://roboticspec.com/events/components/EventCalendar</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
19-
<url><loc>https://roboticspec.com/project</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
20-
<url><loc>https://roboticspec.com/project/components/ProjectCard</loc><lastmod>2025-03-14T06:23:27.827Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
3+
<url><loc>https://roboticspec.com</loc><lastmod>2025-04-07T08:58:20.200Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
4+
<url><loc>https://roboticspec.com/activities</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
5+
<url><loc>https://roboticspec.com/admin</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
6+
<url><loc>https://roboticspec.com/admin/components/ActivitiesEditor</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
7+
<url><loc>https://roboticspec.com/admin/components/BubbleMenu</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
8+
<url><loc>https://roboticspec.com/admin/components/EventsEditor</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
9+
<url><loc>https://roboticspec.com/admin/components/FormatButton</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
10+
<url><loc>https://roboticspec.com/admin/components/HeroEditor</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
11+
<url><loc>https://roboticspec.com/admin/components/MarkdownEditor</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
12+
<url><loc>https://roboticspec.com/admin/components/MenuBar</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
13+
<url><loc>https://roboticspec.com/admin/components/ProjectsEditor</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
14+
<url><loc>https://roboticspec.com/admin/components/ResourceEditor</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
15+
<url><loc>https://roboticspec.com/admin/components/SelectSearch</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
16+
<url><loc>https://roboticspec.com/admin/components/TeamEditor</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
17+
<url><loc>https://roboticspec.com/admin/page</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
18+
<url><loc>https://roboticspec.com/contact</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
19+
<url><loc>https://roboticspec.com/events</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
20+
<url><loc>https://roboticspec.com/events/components/EventCalendar</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
21+
<url><loc>https://roboticspec.com/project</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
22+
<url><loc>https://roboticspec.com/project/components/ProjectCard</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
23+
<url><loc>https://roboticspec.com/resources</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
24+
<url><loc>https://roboticspec.com/resources/components/ResourceCard</loc><lastmod>2025-04-07T08:58:20.201Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
2125
</urlset>

src/components/FormField.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { FormFieldProps } from '@/types'
55
import MarkdownEditor from '../pages/admin/components/MarkdownEditor'
66
import Blob from './Blob'
77
import DatePicker from './DatePicker'
8+
import SelectSearch from '@/pages/admin/components/SelectSearch'
9+
import { teamCategoryOptions } from '@/lib/utils'
810

911
const FormField = ({ htmlFor, title, id, onChange, placeholder, value, type, setFileName, date, setDate }: FormFieldProps) => {
1012

@@ -53,6 +55,18 @@ const FormField = ({ htmlFor, title, id, onChange, placeholder, value, type, set
5355
</div>
5456

5557
)
58+
case "CATEGORY":
59+
60+
return (
61+
<div>
62+
<Label htmlFor={htmlFor}>{title}</Label>
63+
<SelectSearch
64+
options={teamCategoryOptions}
65+
value={value as string}
66+
onChange={(e) => onChange((prev: any) => ({ ...prev, [id]: e }))}
67+
/>
68+
</div>
69+
)
5670
default:
5771
return (
5872
<div className="space-y-2">

src/components/Team.tsx

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,44 @@
11
import { motion } from "framer-motion";
2-
import { TeamMember } from "@/types";
2+
import { TeamData, TeamMember } from "@/types";
33
import Image from "next/image";
44
import PageSection from "@/components/layout/PageSection";
5+
import { teamCategoryOptions } from "@/lib/utils";
56

6-
const Team: React.FC<{ teamMembers: TeamMember[] }> = ({ teamMembers }) => {
7+
const Team: React.FC<{ teamMembers: TeamData }> = ({ teamMembers }) => {
78

89
return (
910
<section className="py-24" id="team">
1011
<PageSection
1112
title="Our Team"
1213
subtitle="Meet the minds behind the innovation"
1314
>
14-
<div className={teamMembers.length >= 4 ? "grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-8" : "grid grid-cols-2 md:flex lg:flex md:justify-center lg:justify-center md:items-center lg:items-center md:gap-8 lg:gap-8"}>
15-
{teamMembers?.map((member: TeamMember, index) => (
16-
<motion.div
17-
key={index}
18-
initial={{ opacity: 0, scale: 0.9 }}
19-
whileInView={{ opacity: 1, scale: 1 }}
20-
transition={{ duration: 0.4 }}
21-
className="glass-card my-5 text-center"
22-
>
23-
<div className="relative w-24 h-24 rounded-full bg-gray-100 mx-auto mb-4">
24-
<Image
25-
src={member.image}
26-
alt={member.firstName}
27-
fill
28-
className="object-contain rounded-[50px]"
29-
/>
15+
<div className={`grid grid-rows-${5 - teamMembers.emptyArrays}`}>
16+
{teamCategoryOptions.map((category: { value: string, label: string }, index) => (
17+
<div className={`${teamMembers[category.value].length <= 0 && "hidden"}`}>
18+
<h1 className="text-center font-bold text-4xl">{category.label}</h1>
19+
<div className={teamMembers.length >= 4 ? "grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-8" : "grid grid-cols-2 md:flex lg:flex md:justify-center lg:justify-center md:items-center lg:items-center md:gap-8 lg:gap-8"}>
20+
{teamMembers[category.value].length > 0 && teamMembers[category.value].map((member: TeamMember, index: number) => (
21+
<motion.div
22+
key={member.id}
23+
initial={{ opacity: 0, scale: 0.9 }}
24+
whileInView={{ opacity: 1, scale: 1 }}
25+
transition={{ duration: 0.4 }}
26+
className="glass-card my-5 text-center"
27+
>
28+
<div className="relative w-24 h-24 rounded-full bg-gray-100 mx-auto mb-4">
29+
<Image
30+
src={member.image}
31+
alt={member.firstName}
32+
fill
33+
className="object-contain rounded-[50px]"
34+
/>
35+
</div>
36+
<p className="text-gray-600">Name : {member.firstName} {member.lastName}</p>
37+
<p className="text-gray-600">Role : {member.role}</p>
38+
</motion.div>
39+
))}
3040
</div>
31-
<p className="text-gray-600">Name : {member.firstName} {member.lastName}</p>
32-
<p className="text-gray-600">Role : {member.role}</p>
33-
</motion.div>
41+
</div>
3442
))}
3543
</div>
3644
</PageSection>

src/lib/supabase/actions/team.actions.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { FormTeamType } from "@/types";
22
import { client } from "../supabase";
33
import { deleteImage, uploadImage } from "./storage.actions";
44
import { urlToBase64 } from "@/lib/utils";
5-
import { PostgrestError } from "@supabase/supabase-js";
65

76
export const getTeamMembers = async () => {
87
const { data, error } = await client.from("team").select("*");
@@ -15,7 +14,7 @@ export const getTeamMemberById = async (id: string) => {
1514
const { data, error } = await client.from("team").select().eq("id", id);
1615

1716
if (error) console.log(error);
18-
if (!data) throw new Error("Project with this id doesn't exist");
17+
if (!data) throw new Error("Team member with this id doesn't exist");
1918
return JSON.parse(JSON.stringify(data[0]));
2019
};
2120

@@ -64,4 +63,12 @@ export const updateTeamMember = async (member: FormTeamType, fileName: string) =
6463
}
6564

6665
return error;
66+
};
67+
68+
export const getTeamMembersByCategory = async (category: string) => {
69+
const { data, error } = await client.from("team").select("*").eq("category", category);
70+
71+
if (error) console.log(error);
72+
if (!data) throw new Error("Team with this category doesn't exist");
73+
return data;
6774
};

src/lib/utils.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,12 @@ export function getNextValidTime(startTime: TimeValue, interval: number = 1): Ti
156156
}
157157

158158
return { hours, minutes, period };
159-
}
159+
};
160+
161+
export const teamCategoryOptions = [
162+
{ value: "leader", label: "Leader" },
163+
{ value: "website", label: "Website" },
164+
{ value: "mechanical", label: "Mechanical" },
165+
{ value: "electrical", label: "Electrical" },
166+
{ value: "software", label: "Software" },
167+
];

0 commit comments

Comments
 (0)