refactor: migrate link component

This commit is contained in:
unix
2020-05-08 16:49:26 +08:00
parent bb1e7c40ca
commit 495cc55e05
33 changed files with 103 additions and 81 deletions

View File

@@ -23,9 +23,7 @@ const VirtualAnchor: React.FC<React.PropsWithChildren<Props>> = ({ children, pur
return (
<span className="parent" ref={ref}>
<Link pure href={`#${id}`}>
{children}
</Link>
<Link href={`#${id}`}>{children}</Link>
<span className="virtual" id={id} />
{!pure && (
<span className="icon">

View File

@@ -46,13 +46,13 @@ const Contributors: React.FC<Props> = ({ path }) => {
<div className="contributors">
{users.map((user, index) => (
<Tooltip text={<b>{user.name}</b>} key={`${user.url}-${index}`}>
<Link color pure target="_blank" rel="nofollow" href={user.url}>
<Link color target="_blank" rel="nofollow" href={user.url}>
<Avatar src={user.avatar} />
</Link>
</Tooltip>
))}
<Tooltip text={isChinese ? '在 GitHub 上编辑此页面' : 'Edit this page on GitHub'} type="dark">
<Link color pure target="_blank" rel="nofollow" href={link}>
<Link color target="_blank" rel="nofollow" href={link}>
<Avatar text="Add" />
</Link>
</Tooltip>