refact: rename Column components to be generic

This commit is contained in:
Jean-Philippe Sirois
2019-11-11 17:18:09 -08:00
parent ba88927304
commit 711da3c517
25 changed files with 553 additions and 555 deletions
+18
View File
@@ -0,0 +1,18 @@
import React, { FC } from "react"
import * as SC from "./styles"
interface ILinkProps {
to: string
}
export const Link: FC<ILinkProps> = ({ children, to }) => {
if (!to.match(/^(https?:\/\/)/)) {
return <SC.LinkInternal to={to}>{children}</SC.LinkInternal>
}
return (
<SC.LinkExternal href={to} target="_blank">
{children}
</SC.LinkExternal>
)
}
+24
View File
@@ -0,0 +1,24 @@
import { Link } from "gatsby"
import styled, { css } from "styled-components"
const linkStyle = css`
color: #0090d8;
font-weight: 700;
border-bottom: 2px solid;
text-decoration: none;
transition: color 0.3s;
&:hover,
&:focus {
color: #5dbbea;
transition: none;
}
`
export const LinkInternal = styled(Link)`
${linkStyle}
`
export const LinkExternal = styled.a`
${linkStyle}
`