Skip to content

Commit ce03ff4

Browse files
committed
make cards clickable
1 parent b960385 commit ce03ff4

File tree

1 file changed

+12
-27
lines changed

1 file changed

+12
-27
lines changed

src/components/tutorials/TutorialsShowcase.tsx

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const TutorialCard: React.FC<{
3434
const imagePath = tutorial.leadimage ? `/images/aws/${tutorial.leadimage}` : '/images/aws/banner.png';
3535

3636
return (
37-
<div className="tutorial-card">
37+
<a href={`/${tutorial.slug}/`} className="tutorial-card">
3838
<div className="card-image">
3939
<img src={tutorial.leadimage} alt={tutorial.title} loading="lazy" />
4040
<div className="card-badges">
@@ -60,16 +60,9 @@ const TutorialCard: React.FC<{
6060
<div className="service-more">+{tutorial.services.length - 8}</div>
6161
)}
6262
</div>
63-
64-
<a
65-
href={`/${tutorial.slug}/`}
66-
className="card-link"
67-
>
68-
Read Tutorial →
69-
</a>
7063
</div>
7164
</div>
72-
</div>
65+
</a>
7366
);
7467
};
7568

@@ -302,11 +295,21 @@ export const TutorialsShowcase: React.FC<TutorialsShowcaseProps> = ({
302295
border-radius: 0.75rem;
303296
overflow: hidden;
304297
transition: transform 0.2s ease, box-shadow 0.2s ease;
298+
text-decoration: none;
299+
color: inherit;
300+
display: block;
301+
cursor: pointer;
305302
}
306303
307304
.tutorial-card:hover {
308305
transform: translateY(-2px);
309306
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
307+
border-color: var(--sl-color-accent);
308+
}
309+
310+
.tutorial-card:focus {
311+
outline: 2px solid var(--sl-color-accent);
312+
outline-offset: 2px;
310313
}
311314
312315
.card-image {
@@ -408,24 +411,6 @@ export const TutorialsShowcase: React.FC<TutorialsShowcaseProps> = ({
408411
color: var(--sl-color-gray-3);
409412
}
410413
411-
.card-link {
412-
display: inline-flex;
413-
align-items: center;
414-
gap: 0.5rem;
415-
color: white;
416-
text-decoration: none;
417-
font-weight: 500;
418-
font-size: 0.875rem;
419-
padding: 0.5rem 0.75rem;
420-
border-radius: 0.375rem;
421-
transition: all 0.2s ease;
422-
white-space: nowrap;
423-
}
424-
425-
.card-link:hover {
426-
color: var(--sl-color-accent);
427-
}
428-
429414
/* No Results */
430415
.no-results {
431416
grid-column: 1 / -1;

0 commit comments

Comments
 (0)