Skip to content

Commit

Permalink
Merge pull request #55 from visiky/fix-pr-54
Browse files Browse the repository at this point in the history
fix: 修复头部链接
  • Loading branch information
visiky authored Mar 14, 2022
2 parents 9c12aa8 + a36c56e commit c3d8f51
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/layout/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ import './header.less';

const Header: React.FC = () => {
const [ModeSwitcher] = useModeSwitcher({});
const query = getSearchObj();

function gotoOnlineVersion() {
const query = getSearchObj();
if (typeof window !== 'undefined') {
window.open(`https://visiky.github.io/resume/?user=${query.user}`);
}
}

return (
<header>
<span />
<span>
{ModeSwitcher}
<a className={'action-link'} href={`/?user=${query.user}`} target="_blank">在线版本</a>
<span className={'action-link'} onClick={gotoOnlineVersion}>
在线版本
</span>
<LangSwitcher />
</span>
</header>
Expand Down

0 comments on commit c3d8f51

Please sign in to comment.