Skip to content

Commit 5878887

Browse files
committed
add external link overlay
1 parent 5322ba9 commit 5878887

File tree

2 files changed

+93
-30
lines changed

2 files changed

+93
-30
lines changed

src/components/IntegrationGrid/IntegrationGrid.tsx

Lines changed: 53 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,37 +72,60 @@ function IntegrationCard({ integration }: { integration: IntegrationData }) {
7272

7373
const linkTo = getNavigationLink(integration.docsLink, integration.slug);
7474

75+
// Check if this is an external link (not to clickhouse.com/docs)
76+
const isExternalLink = linkTo.startsWith('http') && !linkTo.includes('clickhouse.com/docs');
77+
7578
return (
76-
<Link
77-
to={linkTo}
78-
style={{ textDecoration: 'none', color: 'inherit' }}
79-
>
80-
<CUICard style={{ position: 'relative' }}>
81-
{/* Tier Icon in top right corner */}
82-
{integration.integration_tier && integration.integration_tier !== 'community' && (
83-
<div style={{
84-
position: 'absolute',
85-
top: '12px',
86-
right: '12px',
87-
zIndex: 1,
88-
opacity: 0.7
89-
}}>
90-
{getTierIcon(integration.integration_tier)}
91-
</div>
92-
)}
93-
<CUICard.Body>
94-
<CUICard.Header>
95-
<img
96-
src={getLogoSrc()}
97-
alt={`${integration.integration_title || integration.slug} logo`}
98-
/>
99-
</CUICard.Header>
100-
<CUICard.Footer>
101-
{integration.integration_title}
102-
</CUICard.Footer>
103-
</CUICard.Body>
104-
</CUICard>
105-
</Link>
79+
<div className={styles.cardWrapper}>
80+
<Link
81+
to={linkTo}
82+
style={{ textDecoration: 'none', color: 'inherit' }}
83+
>
84+
<CUICard style={{ position: 'relative' }}>
85+
{/* Tier Icon in top right corner */}
86+
{integration.integration_tier && integration.integration_tier !== 'community' && (
87+
<div style={{
88+
position: 'absolute',
89+
top: '12px',
90+
right: '12px',
91+
zIndex: 1,
92+
opacity: 0.7
93+
}}>
94+
{getTierIcon(integration.integration_tier)}
95+
</div>
96+
)}
97+
<CUICard.Body>
98+
<CUICard.Header>
99+
<img
100+
src={getLogoSrc()}
101+
alt={`${integration.integration_title || integration.slug} logo`}
102+
/>
103+
</CUICard.Header>
104+
<CUICard.Footer>
105+
{integration.integration_title}
106+
</CUICard.Footer>
107+
</CUICard.Body>
108+
</CUICard>
109+
</Link>
110+
{/* External link overlay */}
111+
{isExternalLink && (
112+
<div className={styles.externalLinkOverlay}>
113+
<svg
114+
fill="none"
115+
stroke="currentColor"
116+
viewBox="0 0 24 24"
117+
xmlns="http://www.w3.org/2000/svg"
118+
>
119+
<path
120+
strokeLinecap="round"
121+
strokeLinejoin="round"
122+
strokeWidth={2}
123+
d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
124+
/>
125+
</svg>
126+
</div>
127+
)}
128+
</div>
106129
);
107130
}
108131

src/components/IntegrationGrid/styles.module.scss

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,44 @@
178178
font-size: 1.1rem;
179179
margin: 0;
180180
}
181+
}
182+
183+
.externalLinkOverlay {
184+
position: absolute;
185+
top: 0;
186+
left: 0;
187+
right: 0;
188+
bottom: 0;
189+
background: rgba(0, 0, 0, 0.15);
190+
backdrop-filter: blur(4px);
191+
-webkit-backdrop-filter: blur(4px);
192+
display: flex;
193+
align-items: center;
194+
justify-content: center;
195+
opacity: 0;
196+
transition: opacity 0.2s ease;
197+
border-radius: 8px;
198+
pointer-events: none;
199+
200+
[data-theme='dark'] & {
201+
background: rgba(255, 255, 255, 0.15);
202+
}
203+
204+
svg {
205+
width: 32px;
206+
height: 32px;
207+
color: white;
208+
209+
[data-theme='dark'] & {
210+
color: var(--ifm-color-emphasis-800);
211+
}
212+
}
213+
}
214+
215+
.cardWrapper {
216+
position: relative;
217+
218+
&:hover .externalLinkOverlay {
219+
opacity: 1;
220+
}
181221
}

0 commit comments

Comments
 (0)