Files
reflector/www/app/components/MinimalHeader.tsx
Mathieu Virbel 98e05e484a feat: complete calendar integration with UI improvements and code cleanup
Calendar Integration Tasks:
- Update upcoming meetings window from 30 to 120 minutes
- Include currently happening events in upcoming meetings API
- Create shared time utility functions (formatDateTime, formatCountdown, formatStartedAgo)
- Improve ongoing meetings UI logic with proper time detection
- Fix backend code organization and remove excessive documentation

UI/UX Improvements:
- Restructure room page layout using MinimalHeader pattern
- Remove borders from header and footer elements
- Change button text from "Leave Meeting" to "Leave Room"
- Remove "Back to Reflector" footer for cleaner design
- Extract WaitPageClient component for better separation

Backend Changes:
- calendar_events.py: Fix import organization and extend timing window
- rooms.py: Update API default from 30 to 120 minutes
- Enhanced test coverage for ongoing meeting scenarios

Frontend Changes:
- MinimalHeader: Add onLeave prop for custom navigation
- MeetingSelection: Complete layout restructure with shared utilities
- timeUtils: New shared utility file for consistent time formatting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 08:51:40 -06:00

80 lines
1.7 KiB
TypeScript

"use client";
import { Flex, Link, Button, Text } from "@chakra-ui/react";
import NextLink from "next/link";
import Image from "next/image";
import { useRouter } from "next/navigation";
interface MinimalHeaderProps {
roomName: string;
displayName?: string;
showLeaveButton?: boolean;
onLeave?: () => void;
}
export default function MinimalHeader({
roomName,
displayName,
showLeaveButton = true,
onLeave,
}: MinimalHeaderProps) {
const router = useRouter();
const handleLeaveMeeting = () => {
if (onLeave) {
onLeave();
} else {
router.push(`/${roomName}`);
}
};
const roomTitle = displayName
? displayName.endsWith("'s") || displayName.endsWith("s")
? `${displayName} Room`
: `${displayName}'s Room`
: `${roomName} Room`;
return (
<Flex
as="header"
justify="space-between"
alignItems="center"
w="100%"
py="2"
px="4"
bg="white"
position="sticky"
top="0"
zIndex="10"
>
{/* Logo and Room Context */}
<Flex alignItems="center" gap={3}>
<Link as={NextLink} href="/" className="flex items-center">
<Image
src="/reach.svg"
width={24}
height={30}
className="h-8 w-auto"
alt="Reflector"
/>
</Link>
<Text fontSize="lg" fontWeight="semibold" color="gray.700">
{roomTitle}
</Text>
</Flex>
{/* Leave Room Button */}
{showLeaveButton && (
<Button
variant="outline"
colorScheme="gray"
size="sm"
onClick={handleLeaveMeeting}
>
Leave Room
</Button>
)}
</Flex>
);
}