Skip to content

Commit 32e10e9

Browse files
authored
Merge pull request #148 from Encaik/feat-seo优化
fix: 修复按钮可访问性,优化用户交互
2 parents 94a98d8 + ba7dd68 commit 32e10e9

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

src/components/dropdown/Dropdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ function Dropdown(props: DropdownProps, ref: any) {
157157
{props.options?.map((opt: option) => (
158158
<a
159159
key={opt.key}
160+
href={`${opt.key}`}
160161
className='block cursor-pointer truncate rounded-lg px-1 py-2 text-left text-sm text-gray-500 hover:bg-gray-50 hover:text-gray-700 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-gray-300'
161162
onClick={() => onChange(opt)}
162163
>

src/components/navbar/IndexBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ const IndexBar: NextPage<Props> = ({ t, i18n_lang, tid, sort_by }) => {
4343
<div className='shrink grow'></div>
4444
<div className='md:hidden'>
4545
<RepoModal>
46-
<a className='flex h-8 items-center rounded-lg bg-blue-500 px-3 text-xs text-white active:bg-blue-600 dark:bg-gray-700 dark:text-gray-300 dark:active:bg-gray-900 sm:px-4'>
46+
<button className='flex h-8 items-center rounded-lg bg-blue-500 px-3 text-xs text-white active:bg-blue-600 dark:bg-gray-700 dark:text-gray-300 dark:active:bg-gray-900 sm:px-4'>
4747
{t('nav.submit')}
48-
</a>
48+
</button>
4949
</RepoModal>
5050
</div>
5151
</div>

src/components/navbar/RepoNavbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ const RepoDetailNavbar = ({ avatar, uid, t }: Props) => {
3535
<NoPrefetchLink href={`/user/${uid}`}>
3636
<div className='flex cursor-pointer items-center justify-end text-xs text-gray-500 hover:text-blue-400 dark:text-gray-400'>
3737
{t('nav.desc')}
38-
<a className='m-1 flex items-center'>
38+
<div className='m-1 flex items-center'>
3939
<img
4040
className='rounded-full hover:animate-spin'
4141
src={avatar}
4242
width='18'
4343
height='18'
4444
alt='navbar_avatar'
4545
/>
46-
</a>
46+
</div>
4747
{t('nav.desc2')}
4848
</div>
4949
</NoPrefetchLink>

src/pages/onefile/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const OneFilePage: NextPage<OneItemsResp> = ({ data }) => {
5454
<img
5555
className='w-max-full'
5656
src='https://img.hellogithub.com/article/tK30nYW8bMiPOdB_1647991896.png'
57+
alt='onefile'
5758
></img>
5859
<p className='my-4 px-2'>
5960
<Trans ns='onefile' i18nKey='p_text' />

src/pages/periodical/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ const PeriodicalIndexPage: NextPage = () => {
6262
<Navbar middleText={t('nav')} />
6363
<div className='my-2 bg-white px-4 pt-2 dark:bg-gray-800 md:rounded-lg'>
6464
<div className='flex flex-col items-center'>
65-
<img src='https://img.hellogithub.com/logo/readme.gif'></img>
65+
<img
66+
src='https://img.hellogithub.com/logo/readme.gif'
67+
alt='HelloGithub'
68+
></img>
6669
<p className='px-1 py-3 leading-7'>
6770
<Trans ns='periodical' i18nKey='p_text' />
6871
</p>

0 commit comments

Comments
 (0)