Skip to content

Commit

Permalink
feat: Add custom url to features
Browse files Browse the repository at this point in the history
  • Loading branch information
AnisioMandlate committed Aug 14, 2020
1 parent d1f3b50 commit ee58d98
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const features = [
description: (
<>Access Developer Documentation and start transacting online. </>
),
link: <Link to="https://developers.paymentsds.org/docs/"> Get SDKs </Link>,
link: { text: "Documentation" },
},
{
title: <>SDKs</>,
Expand All @@ -24,12 +24,18 @@ const features = [
more.
</>
),
link: <Link to="https://github.com/paymentsds"> Get SDKs </Link>,
link: { url: "https://github.com/paymentsds", text: "Get SDKs" },
},
];

function Feature({ imageUrl, title, description, link }) {
function Feature({
imageUrl,
title,
description,
link: { url = null, text = "" },
}) {
const imgUrl = useBaseUrl(imageUrl);

return (
<div className={clsx("col col--4", styles.feature)}>
{imgUrl && (
Expand All @@ -40,7 +46,9 @@ function Feature({ imageUrl, title, description, link }) {
<div className="text--center">
<h3>{title}</h3>
<p>{description}</p>
<p>{link}</p>
<p>
<Link to={url ?? useBaseUrl("/docs")}>{text}</Link>
</p>
</div>
</div>
);
Expand All @@ -49,6 +57,7 @@ function Feature({ imageUrl, title, description, link }) {
function Home() {
const context = useDocusaurusContext();
const { siteConfig = {} } = context;
const docLink = useBaseUrl("docs/");
return (
<Layout
title={siteConfig.title}
Expand All @@ -66,7 +75,7 @@ function Home() {
"button button--outline button--secondary button--lg",
styles.getStarted
)}
to={useBaseUrl("docs/")}
to={docLink}
>
Get Started
</Link>
Expand Down

0 comments on commit ee58d98

Please sign in to comment.