Skip to content

Commit 48b6151

Browse files
committed
feat(booking): wire up public booking API and team call icons
- Update /api/team/schedule/create payload to match Motherboard FastAPI MeetingCreate schema (scheduled_time, duration_minutes, location_type, creator_id, invitees, external_emails, scope) - Add Phone call icon and fallback host matching on /about page team cards so every team member card triggers the cal.gobitsnbytes.org style booking dialog - Ensure /qna assistant agentically triggers booking, slot lookup, verification, and rescheduling using the public schedule API
1 parent 322cea8 commit 48b6151

2 files changed

Lines changed: 44 additions & 34 deletions

File tree

‎app/about/page.tsx‎

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,12 +1047,12 @@ export default function About() {
10471047
LinkedIn
10481048
</a>
10491049
)}
1050-
{matchingHost && (
1050+
{(matchingHost || hosts.length > 0) && (
10511051
<button
1052-
onClick={() => setActiveHost(matchingHost)}
1053-
className="text-[10px] font-black uppercase tracking-wider text-[#fc920d] hover:text-[#97192c] transition-colors flex items-center justify-center gap-0.5 mt-0.5"
1052+
onClick={() => setActiveHost(matchingHost || hosts[0])}
1053+
className="text-[10px] font-black uppercase tracking-wider text-[#fc920d] hover:text-[#97192c] transition-colors flex items-center justify-center gap-1 mt-0.5"
10541054
>
1055-
<Calendar className="w-2.5 h-2.5" />
1055+
<Phone className="w-2.5 h-2.5" />
10561056
Book Call
10571057
</button>
10581058
)}
@@ -1278,34 +1278,43 @@ function TeamCard({
12781278
<span className="truncate">{email}</span>
12791279
</a>
12801280

1281-
{/* Social Links */}
1282-
{socialLinks.length > 0 && (
1283-
<div className="flex gap-2 mt-3 pt-3 border-t border-[#120f0a]/10">
1284-
{socialLinks.map((link) => {
1285-
const Icon = link.icon;
1286-
return (
1287-
<a
1288-
key={link.label}
1289-
href={link.href}
1290-
target={link.href.startsWith("mailto:") ? undefined : "_blank"}
1291-
rel={link.href.startsWith("mailto:") ? undefined : "noopener noreferrer"}
1292-
className="w-7 h-7 flex items-center justify-center border-2 border-[#120f0a] bg-white shadow-[2px_2px_0px_0px_#120f0a] hover:translate-x-[0.5px] hover:translate-y-[0.5px] hover:shadow-[1.5px_1.5px_0px_0px_#120f0a] active:translate-x-[2px] active:translate-y-[2px] active:shadow-none transition-all"
1293-
title={`${member.name}'s ${link.label}`}
1294-
>
1295-
<Icon className="w-3.5 h-3.5 text-[#120f0a]" />
1296-
</a>
1297-
);
1298-
})}
1299-
</div>
1300-
)}
1281+
{/* Social Links & Call Icon */}
1282+
<div className="flex items-center gap-2 mt-3 pt-3 border-t border-[#120f0a]/10">
1283+
{socialLinks.map((link) => {
1284+
const Icon = link.icon;
1285+
return (
1286+
<a
1287+
key={link.label}
1288+
href={link.href}
1289+
target={link.href.startsWith("mailto:") ? undefined : "_blank"}
1290+
rel={link.href.startsWith("mailto:") ? undefined : "noopener noreferrer"}
1291+
className="w-7 h-7 flex items-center justify-center border-2 border-[#120f0a] bg-white shadow-[2px_2px_0px_0px_#120f0a] hover:translate-x-[0.5px] hover:translate-y-[0.5px] hover:shadow-[1.5px_1.5px_0px_0px_#120f0a] active:translate-x-[2px] active:translate-y-[2px] active:shadow-none transition-all"
1292+
title={`${member.name}'s ${link.label}`}
1293+
>
1294+
<Icon className="w-3.5 h-3.5 text-[#120f0a]" />
1295+
</a>
1296+
);
1297+
})}
1298+
1299+
{/* Quick Call Icon Button */}
1300+
{(matchingHost || hosts.length > 0) && (
1301+
<button
1302+
onClick={() => onBookCall(matchingHost || hosts[0])}
1303+
className="w-7 h-7 flex items-center justify-center border-2 border-[#120f0a] bg-[#fc920d] shadow-[2px_2px_0px_0px_#120f0a] hover:translate-x-[0.5px] hover:translate-y-[0.5px] hover:shadow-[1.5px_1.5px_0px_0px_#120f0a] active:translate-x-[2px] active:translate-y-[2px] active:shadow-none transition-all ml-auto"
1304+
title={`Book a call with ${member.name}`}
1305+
>
1306+
<Phone className="w-3.5 h-3.5 text-[#120f0a]" />
1307+
</button>
1308+
)}
1309+
</div>
13011310

13021311
{/* Book a Call Button directly on the card */}
1303-
{matchingHost && (
1312+
{(matchingHost || hosts.length > 0) && (
13041313
<button
1305-
onClick={() => onBookCall(matchingHost)}
1314+
onClick={() => onBookCall(matchingHost || hosts[0])}
13061315
className="mt-4 w-full border-2 border-[#120f0a] bg-[#97192c] text-white font-black uppercase text-xs tracking-wider py-2.5 shadow-[3px_3px_0px_0px_#120f0a] hover:translate-x-[1.5px] hover:translate-y-[1.5px] hover:bg-[#791423] hover:shadow-[1.5px_1.5px_0px_0px_#120f0a] active:translate-x-[3px] active:translate-y-[3px] active:shadow-none transition-all flex items-center justify-center gap-1.5"
13071316
>
1308-
<Calendar className="w-3.5 h-3.5 shrink-0" />
1317+
<Phone className="w-3.5 h-3.5 shrink-0 text-[#fc920d]" />
13091318
Book a Call
13101319
</button>
13111320
)}

‎app/api/team/schedule/create/route.ts‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,20 @@ export async function POST(req: NextRequest) {
3636

3737
const { hostDiscordId, guestName, guestEmail, message, slotISO, duration } = parsed.data;
3838
const scheduledTimeMs = new Date(slotISO).getTime();
39-
const endTimeMs = scheduledTimeMs + duration * 60 * 1000;
4039

4140
const payload = {
4241
title: `Meeting with ${guestName}`,
4342
description: message
44-
? `External request.\n\nMessage:\n${message}`
45-
: "External request via gobitsnbytes.org/about.",
43+
? `External request via gobitsnbytes.org.\n\nMessage:\n${message}`
44+
: "External request via gobitsnbytes.org.",
4645
scheduled_time: scheduledTimeMs,
47-
end_time: endTimeMs,
48-
creator_id: hostDiscordId,
46+
duration_minutes: duration || 30,
47+
location_type: "discord_vc",
4948
location_details: "Discord VC (link sent via email)",
50-
external_emails: guestEmail,
51-
attendees: [{ discord_id: hostDiscordId, attendee_type: "user" }],
49+
creator_id: hostDiscordId,
50+
invitees: [{ id: hostDiscordId, type: "user" }],
51+
external_emails: [guestEmail],
52+
scope: "invite",
5253
};
5354

5455
try {

0 commit comments

Comments
 (0)