-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContactModal.jsx
More file actions
251 lines (241 loc) · 8.3 KB
/
Copy pathContactModal.jsx
File metadata and controls
251 lines (241 loc) · 8.3 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
import React from 'react';
import {
EnvelopeSimpleIcon,
LinkedinLogoIcon,
XLogoIcon,
GithubLogoIcon,
GlobeIcon,
RedditLogoIcon,
ArrowUpRightIcon,
} from '@phosphor-icons/react';
import GenericModal from './GenericModal';
import { useSiteConfig } from '../context/SiteConfigContext';
import { useVisualSettings } from '../context/VisualSettingsContext';
const socialIcons = {
GithubLogo: GithubLogoIcon,
XLogo: XLogoIcon,
LinkedinLogo: LinkedinLogoIcon,
EnvelopeSimple: EnvelopeSimpleIcon,
RedditLogo: RedditLogoIcon,
};
const ContactModal = ({ isOpen, onClose }) => {
const { config } = useSiteConfig();
const { fezcodexTheme } = useVisualSettings();
const isLuxe = fezcodexTheme === 'luxe';
const isTerracotta = fezcodexTheme === 'terracotta';
const isMist = fezcodexTheme === 'mist';
const title = (() => {
if (isLuxe) return 'Establish Contact';
if (isTerracotta) return 'Correspondence';
if (isMist) return 'Through the Fog';
return 'Contact';
})();
return (
<GenericModal isOpen={isOpen} onClose={onClose} title={title}>
<div className="flex flex-col gap-6">
{isLuxe && (
<p className="font-outfit text-sm text-[#1A1A1A]/60 italic leading-relaxed mb-2">
Choose a preferred channel to initiate communication with the
primary node.
</p>
)}
{isTerracotta && (
<div className="mb-1 flex items-center gap-3">
<span className="h-[2px] w-[36px] bg-[#C96442]" />
<p className="font-ibm-plex-mono text-[9.5px] uppercase tracking-[0.28em] text-[#2E2620]/70">
Channels · open for letters
</p>
</div>
)}
{isMist && (
<div className="mb-1 flex items-center gap-3">
<span
aria-hidden="true"
className="h-px w-[36px]"
style={{
background:
'linear-gradient(90deg, rgba(95,131,123,0.6), transparent)',
}}
/>
<p className="font-ibm-plex-mono lowercase text-[10px] tracking-[0.26em] text-[#8A9894]">
channels · reachable in the half-light
</p>
</div>
)}
{!isLuxe && !isTerracotta && !isMist && (
<p className="text-gray-400 mb-2 font-mono uppercase tracking-widest text-[10px]">
{'//'} Establish connection via established protocols:
</p>
)}
<div
className={`grid grid-cols-1 ${
isLuxe
? 'gap-4'
: isTerracotta
? 'gap-0 border-t border-[#1A161320]'
: isMist
? 'gap-0'
: 'gap-3'
}`}
>
{config?.socials &&
config.socials.map((link) => {
const Icon = socialIcons[link.icon] || GlobeIcon;
const cleaned = link.url
.replace(/^mailto:/, '')
.replace(/^https?:\/\//, '');
if (isLuxe) {
return (
<LuxeContactLink
key={link.id}
href={link.url}
icon={Icon}
label={link.label}
value={cleaned}
/>
);
}
if (isTerracotta) {
return (
<TerracottaContactLink
key={link.id}
href={link.url}
icon={Icon}
label={link.label}
value={cleaned}
/>
);
}
if (isMist) {
return (
<MistContactLink
key={link.id}
href={link.url}
icon={Icon}
label={link.label}
value={cleaned}
/>
);
}
return (
<BrutalistContactLink
key={link.id}
href={link.url}
icon={Icon}
label={link.label}
value={cleaned}
/>
);
})}
</div>
</div>
</GenericModal>
);
};
const TerracottaContactLink = ({ href, icon: Icon, label, value }) => (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
className="group relative grid grid-cols-[52px_140px_1fr_auto] items-center gap-4 px-4 py-4 border-b border-[#1A161320] hover:bg-[#E8DECE]/60 transition-colors"
>
<span
aria-hidden="true"
className="absolute left-0 top-0 bottom-0 w-[2px] bg-[#C96442] opacity-0 group-hover:opacity-100 transition-opacity"
/>
<div className="flex items-center justify-center w-10 h-10 border border-[#1A161330] text-[#1A1613] group-hover:border-[#C96442] group-hover:text-[#9E4A2F] transition-colors">
<Icon size={20} weight="duotone" />
</div>
<span className="font-ibm-plex-mono text-[9.5px] uppercase tracking-[0.28em] text-[#C96442]">
{label}
</span>
<span className="font-fraunces italic text-[16px] text-[#1A1613] truncate">
{value}
</span>
<ArrowUpRightIcon
size={14}
weight="bold"
className="text-[#1A161340] group-hover:text-[#9E4A2F] transition-colors"
/>
</a>
);
const MistContactLink = ({ href, icon: Icon, label, value }) => (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
className="group relative grid grid-cols-[52px_140px_1fr_auto] items-center gap-4 rounded-xl px-4 py-4 transition-colors hover:bg-[#E5EBE9]/70"
>
<span
aria-hidden="true"
className="absolute bottom-0 left-0 right-0 h-px"
style={{
background:
'linear-gradient(90deg, transparent, rgba(60,72,69,0.14), transparent)',
}}
/>
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-white/70 text-[#5C6B67] shadow-[0_6px_18px_rgba(60,72,69,0.10)] group-hover:text-[#5F837B] transition-colors">
<Icon size={20} weight="light" />
</div>
<span className="font-ibm-plex-mono lowercase text-[10px] tracking-[0.26em] text-[#8A9894] group-hover:text-[#5F837B] transition-colors">
{label}
</span>
<span className="font-instr-serif italic text-[17px] text-[#3C4845] truncate">
{value}
</span>
<ArrowUpRightIcon
size={14}
weight="light"
className="text-[#8A9894] group-hover:text-[#5F837B] transition-colors"
/>
</a>
);
const LuxeContactLink = ({ href, icon: Icon, label, value }) => (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
className="group flex items-center justify-between border border-[#1A1A1A]/5 bg-[#FAFAF8] p-6 transition-all hover:bg-white hover:shadow-xl hover:border-[#8D4004]/20 rounded-sm"
>
<div className="flex items-center gap-6">
<div className="w-12 h-12 flex items-center justify-center bg-white rounded-full shadow-sm text-[#1A1A1A]/40 group-hover:text-[#8D4004] transition-colors">
<Icon size={24} weight="light" />
</div>
<div className="flex flex-col">
<span className="text-[10px] font-outfit uppercase tracking-[0.2em] text-[#1A1A1A]/40">
{label}
</span>
<span className="font-playfairDisplay text-lg italic text-[#1A1A1A]">
{value}
</span>
</div>
</div>
<ArrowUpRightIcon
size={18}
className="text-[#1A1A1A]/10 group-hover:text-[#8D4004] transition-colors"
/>
</a>
);
const BrutalistContactLink = ({ href, icon: Icon, label, value }) => (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
className="group flex items-center justify-between border border-white/10 bg-white/[0.02] p-4 transition-all hover:bg-emerald-500 hover:text-black hover:border-emerald-500 rounded-sm"
>
<div className="flex items-center gap-4">
<Icon
size={24}
weight="bold"
className="text-emerald-500 group-hover:text-black transition-colors"
/>
<div className="flex flex-col text-white group-hover:text-black">
<span className="text-[10px] font-mono uppercase tracking-widest opacity-50">
{label}
</span>
<span className="font-bold tracking-tight">{value}</span>
</div>
</div>
</a>
);
export default ContactModal;