mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-06 07:56:11 +02:00
refact: convert components to use React.FC type + type improvements
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
d61c218657
commit
1d88367645
@@ -1,12 +1,14 @@
|
||||
import React, { PropsWithChildren } from "react"
|
||||
import React, { FC } from "react"
|
||||
import * as SC from "./styles"
|
||||
|
||||
export function ResourcesLink({
|
||||
interface IResourcesLinkProps {
|
||||
to: string
|
||||
}
|
||||
|
||||
export const ResourcesLink: FC<IResourcesLinkProps> = ({
|
||||
children,
|
||||
to,
|
||||
}: PropsWithChildren<{
|
||||
to: string
|
||||
}>) {
|
||||
}) => {
|
||||
if (!to.match(/^(https?:\/\/)/)) {
|
||||
return (
|
||||
<SC.ResourcesLinkInternal to={to}>{children}</SC.ResourcesLinkInternal>
|
||||
|
||||
Reference in New Issue
Block a user