-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathHostRooms.tsx
More file actions
73 lines (68 loc) · 2.42 KB
/
HostRooms.tsx
File metadata and controls
73 lines (68 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { useState } from 'react';
import data from '../afterTownHallData';
import BreakOutRoomForm from './BreakOutRoomForm';
interface BR {
name: string;
host: string;
description: string;
}
const HostRoomCard = ({ br, index, hoveredIndex, setHoveredIndex }: { br: BR; index: number; hoveredIndex: number | null; setHoveredIndex: (index: number | null) => void }) => {
return (
<div
className="relative aspect-square text-center bg-opacity-10 backdrop-blur-md shadow-lg border border-opacity-20 rounded-lg flex flex-col justify-between overflow-hidden transition-all duration-300 ease-in-out"
onMouseEnter={() => setHoveredIndex(index)}
onMouseLeave={() => setHoveredIndex(null)}
style={{
opacity: hoveredIndex === index ? 1 : 0.8,
}}
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1440 640"
className="absolute -z-40 w-full"
>
<path
fill="#6155D8"
fillOpacity="1"
d="M0,320L0,320L120,373C240,427,480,533,720,550C960,567,1200,493,1320,456L1440,420L1440,0L1320,0C1200,0,960,0,720,0C480,0,240,0,120,0L0,0Z"
></path>
</svg>
<div className="flex flex-col justify-between p-8 h-full">
<h2 className="text-white text-2xl phone:text-[16px] sm:text-md md:text-[16.5px] lg:text-lg xl:text-xl font-semibold mb-8">
{br.name}
</h2>
<p className="text-black text-lg font-bold text-opacity-80 mb-4">
Host: {br.host}
</p>
</div>
<div
className={`absolute inset-0 bg-white flex items-center justify-center p-4 transition-opacity duration-300 ${
hoveredIndex === index ? 'opacity-100' : 'opacity-0'
}`}
style={{ pointerEvents: hoveredIndex === index ? 'auto' : 'none' }}
>
<p className="text-black text-lg p-6">{br.description}</p>
</div>
</div>
);
};
const HostRooms = () => {
const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);
return (
<div>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-10">
{data.breakoutRooms.map((br, index) => (
<HostRoomCard
key={index}
br={br}
index={index}
hoveredIndex={hoveredIndex}
setHoveredIndex={setHoveredIndex}
/>
))}
<BreakOutRoomForm />
</div>
</div>
);
};
export default HostRooms;