Skip to content

Commit

Permalink
🐛 fix: 修正 GithubButton 无法正常渲染的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 22, 2023
1 parent 67ef0ce commit d30af71
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/components/GithubButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import { useSiteStore } from '../../store/useSiteStore';
const GithubButton: FC = () => {
const repoUrl = useSiteStore((s) => s.siteData.themeConfig?.github);

return (
repoUrl && (
<Tooltip arrow={false} title={'Github'}>
<a href={repoUrl} target={'_blank'} rel="noreferrer">
<Button icon={<GithubFilled />} />
</a>
</Tooltip>
)
return !repoUrl ? null : (
<Tooltip arrow={false} title={'Github'}>
<a href={repoUrl} target={'_blank'} rel="noreferrer">
<Button icon={<GithubFilled />} />
</a>
</Tooltip>
);
};

Expand Down

0 comments on commit d30af71

Please sign in to comment.