Skip to content

Commit

Permalink
docs: add extraLink param into featured items
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbarion committed Dec 3, 2024
1 parent 06952bc commit 6428906
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docs/src/components/HomepageSponsored/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type FeatureItem = {
eventTitle?: string
link: string
allowsDarkMode?: boolean
extraLink?: string
}

type SponsorItem = FeatureItem & {
Expand All @@ -26,6 +27,7 @@ const FeatureList: FeatureItem[] = [
title: 'Digital Ocean',
Svg: require('@site/static/img/digital-ocean-powered-by.svg').default,
link: 'https://www.digitalocean.com/?refcode=0813b3be1161&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge',
extraLink: '/blog/digital-ocean-app-platform',
},
{
title: 'Algolia',
Expand All @@ -52,10 +54,10 @@ const SponsorList: SponsorItem[] = [
// },
]

function Feature({ title, Svg, link, allowsDarkMode }: FeatureItem) {
function Feature({ title, Svg, link, allowsDarkMode, extraLink }: FeatureItem) {
return (
<div className={clsx('col col--6')}>
<div className="text--center">
<div className={clsx('text--center', styles['feature-item'])}>
<a href={link} title={title} target="_blank" rel="noreferrer" aria-label={title}>
<Svg
className={clsx(styles.featureSvg, {
Expand All @@ -64,6 +66,17 @@ function Feature({ title, Svg, link, allowsDarkMode }: FeatureItem) {
role="img"
/>
</a>
{extraLink && (
<a
href={extraLink}
title={`Learn more about ${title}`}
target="_blank"
rel="noreferrer"
className={styles.featureLink}
>
Learn more about {title}
</a>
)}
</div>
</div>
)
Expand Down
5 changes: 5 additions & 0 deletions docs/src/components/HomepageSponsored/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
gap: 21px;
}

.feature-item {
display: flex;
flex-direction: column;
}

@media screen and (min-width: 1024px) {
.features {
display: flex;
Expand Down

0 comments on commit 6428906

Please sign in to comment.