|
3 | 3 | import React, { memo, useCallback } from 'react'; |
4 | 4 | import { useRouter } from 'next/navigation'; |
5 | 5 | import { Button, Tooltip } from 'antd'; |
6 | | -import { EditOutlined, MenuOutlined } from '@ant-design/icons'; |
| 6 | +import { EditOutlined, MenuOutlined, GithubOutlined } from '@ant-design/icons'; |
7 | 7 | import SearchBar from './SearchBar'; |
8 | 8 | import ThemeToggle from './ThemeToggle'; |
9 | 9 |
|
@@ -75,6 +75,21 @@ const Header = memo(function Header({ onMenuClick }: HeaderProps) { |
75 | 75 | }} |
76 | 76 | /> |
77 | 77 | </Tooltip> |
| 78 | + <Tooltip title="GitHub 项目地址" placement="bottom"> |
| 79 | + <Button |
| 80 | + type="text" |
| 81 | + icon={<GithubOutlined aria-hidden="true" />} |
| 82 | + onClick={() => window.open('https://github.com/weizwz/weiz-nav', '_blank', 'noopener,noreferrer')} |
| 83 | + aria-label="访问 GitHub 项目地址" |
| 84 | + title="GitHub" |
| 85 | + className="flex items-center justify-center" |
| 86 | + style={{ |
| 87 | + fontSize: '18px', |
| 88 | + width: '40px', |
| 89 | + height: '40px', |
| 90 | + }} |
| 91 | + /> |
| 92 | + </Tooltip> |
78 | 93 | </div> |
79 | 94 | </div> |
80 | 95 |
|
@@ -126,6 +141,21 @@ const Header = memo(function Header({ onMenuClick }: HeaderProps) { |
126 | 141 | }} |
127 | 142 | /> |
128 | 143 | </Tooltip> |
| 144 | + <Tooltip title="GitHub 项目地址" placement="bottom"> |
| 145 | + <Button |
| 146 | + type="text" |
| 147 | + icon={<GithubOutlined aria-hidden="true" />} |
| 148 | + onClick={() => window.open('https://github.com/weizwz/weiz-nav', '_blank', 'noopener,noreferrer')} |
| 149 | + aria-label="访问 GitHub 项目地址" |
| 150 | + title="GitHub" |
| 151 | + className="flex items-center justify-center" |
| 152 | + style={{ |
| 153 | + fontSize: '18px', |
| 154 | + width: '40px', |
| 155 | + height: '40px', |
| 156 | + }} |
| 157 | + /> |
| 158 | + </Tooltip> |
129 | 159 | </div> |
130 | 160 | </div> |
131 | 161 |
|
|
0 commit comments