This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/packages/website/src/components/Link/Link.js

27 lines
507 B
JavaScript
Raw Normal View History

2021-03-29 21:32:17 +00:00
import * as React from "react";
import { Link as GatsbyLink } from "gatsby";
2021-03-31 11:24:05 +00:00
export default function Link({
children,
to,
activeClassName,
partiallyActive,
target = "_blank",
rel = "noopener noreferrer",
...params
}) {
2021-03-29 21:32:17 +00:00
if (to) {
return (
<GatsbyLink to={to} activeClassName={activeClassName} partiallyActive={partiallyActive} {...params}>
{children}
</GatsbyLink>
);
}
2021-03-31 11:24:05 +00:00
return (
<a {...params} target={target} rel={rel}>
{children}
</a>
);
2021-03-29 21:32:17 +00:00
}