forked from recodehive/recode-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTopMateCard.tsx
More file actions
150 lines (141 loc) · 4.77 KB
/
TopMateCard.tsx
File metadata and controls
150 lines (141 loc) · 4.77 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import React from "react";
import { motion } from "framer-motion";
import { ArrowUpRight, Clock } from "lucide-react";
import { useSafeColorMode } from "../../utils/useSafeColorMode";
interface TopMateCardProps {
title: string;
description: string;
duration: string;
profileImage: string;
username: string;
setShowTopmate: (value: boolean) => void;
}
const TopMateCard: React.FC<TopMateCardProps> = ({
title,
description,
duration,
profileImage,
username,
setShowTopmate,
}) => {
const { colorMode, isDark } = useSafeColorMode();
return (
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5 }}
className={`hover:shadow-3xl relative mx-auto w-full max-w-md transform overflow-hidden rounded-3xl shadow-2xl transition-all duration-300 hover:-translate-y-1 ${
isDark ? "bg-[#1a1a1a] text-white" : "bg-white text-black"
}`}
>
{/* Decorative Arrows */}
<div className="absolute -top-4 -left-4 flex gap-2">
{[...Array(3)].map((_, i) => (
<motion.div
key={i}
initial={{ opacity: 0, x: -10 }}
animate={{ opacity: 1, x: 0 }}
transition={{ delay: i * 0.1 }}
className="text-purple-500"
>
<ArrowUpRight size={24} className="rotate-45 transform" />
</motion.div>
))}
</div>
{/* Card Content */}
<div className="p-6">
{/* Header */}
<div className="mb-4 flex items-center justify-between">
<div className="flex items-center gap-2">
<span
className={`text-sm font-medium ${
isDark ? "text-gray-300" : "text-gray-600"
}`}
>
1:1 CALL
</span>
<div
className={`flex items-center gap-1 ${
isDark ? "text-gray-400" : "text-gray-500"
}`}
>
<Clock size={16} />
<span className="text-sm">{duration}</span>
</div>
</div>
<button
className={`text-xl font-semibold ${
isDark
? "text-gray-500 hover:text-gray-300"
: "text-gray-400 hover:text-gray-600"
}`}
onClick={() => setShowTopmate(false)}
>
<span className="sr-only">Close</span>×
</button>
</div>
{/* Title */}
<h2
className={`mb-4 text-2xl font-bold ${
isDark ? "text-white" : "text-gray-900"
}`}
>
{title}
</h2>
{/* Description */}
<p className={`${isDark ? "text-gray-300" : "text-gray-600"} mb-6`}>
{description}
</p>
{/* Profile Section */}
<div className="flex flex-wrap items-center justify-between gap-y-3 md:flex-nowrap">
<div className="flex min-w-0 items-center gap-3">
<img
src={profileImage}
alt="Profile"
className="h-12 w-12 rounded-full border-2 border-purple-200 object-cover"
/>
<div className="flex flex-col">
<span
className={`text-sm ${
isDark ? "text-gray-300" : "text-gray-600"
}`}
>
Book a slot at
</span>
<a
href={`https://topmate.io/${username}`}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-1 truncate font-semibold text-purple-500 transition-colors hover:text-purple-600"
>
<span className="truncate">topmate.io/{username}</span>
<ArrowUpRight size={16} />
</a>
</div>
</div>
<div className="flex shrink-0 items-center gap-2">
{/* Show only the circular icon part of the Topmate logo */}
<div className="h-4 w-4 flex-shrink-0 overflow-hidden rounded-sm">
<img
src="/icons/topmate.png"
alt="Topmate icon"
className="h-4 w-auto object-cover object-left opacity-90"
/>
</div>
{/* Theme-aware text to ensure readability on dark backgrounds */}
<span
className={`shrink-0 text-sm font-semibold ${
isDark ? "text-gray-200" : "text-gray-700"
}`}
>
topmate
</span>
</div>
</div>
</div>
{/* Gradient Border Effect */}
<div className="absolute inset-0 -z-10 rounded-3xl border-2 border-transparent bg-gradient-to-br from-purple-500/20 to-pink-500/20" />
</motion.div>
);
};
export default TopMateCard;