mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 23:43:45 +02:00
refact: rename Column components to be generic
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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}
|
||||
`
|
||||
Reference in New Issue
Block a user