Skip to content

Commit

Permalink
docs: fix accessibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Layouwen committed Nov 10, 2024
1 parent f71756a commit 76ae0f5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 37 deletions.
44 changes: 19 additions & 25 deletions docs/components/components/Main/MainSection/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Button } from 'antd-mobile'
import { Link } from 'dumi'
import React, { useEffect, useState } from 'react'
import Lottie from 'react-lottie'
import { useTrans } from '../../../../hooks/useTrans'
import { openUrl } from '../../../../utils'
import styles from './index.local.less'

export default (props: { isWidthScreen: boolean }) => {
Expand Down Expand Up @@ -36,30 +36,24 @@ export default (props: { isWidthScreen: boolean }) => {
)}
</div>
<div className={styles.mainSectionButtonAction}>
<Button
color='primary'
shape='rounded'
className={styles.buttonLeft}
onClick={() =>
openUrl({
href: trans('/guide/quick-start', '/zh/guide/quick-start'),
})
}
>
{trans('Get Start', '开始使用')}
</Button>
<Button
color='primary'
shape='rounded'
className={styles.buttonRight}
onClick={() =>
openUrl({
href: trans('/components', '/zh/components'),
})
}
>
{trans('Preview Online', '在线体验')}
</Button>
<Link to={trans('/guide/quick-start', '/zh/guide/quick-start')}>
<Button
color='primary'
shape='rounded'
className={styles.buttonLeft}
>
{trans('Get Start', '开始使用')}
</Button>
</Link>
<Link to={trans('/components', '/zh/components')}>
<Button
color='primary'
shape='rounded'
className={styles.buttonRight}
>
{trans('Preview Online', '在线体验')}
</Button>
</Link>
</div>
</div>
<div className={styles.imageContainer}>
Expand Down
18 changes: 6 additions & 12 deletions docs/components/components/Main/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { RightOutlined } from '@ant-design/icons'
import { useSize } from 'ahooks'
import { Button, Card } from 'antd-mobile'
import { Link } from 'dumi'
import React, { useEffect, useRef, useState } from 'react'
import Lottie from 'react-lottie'
import { useTrans } from '../../../hooks/useTrans'
import { openUrl } from '../../../utils'
import MainSection from './MainSection'
import {
getGuides,
Expand Down Expand Up @@ -98,17 +98,11 @@ export default () => {
<div className={styles.productResourceCardDescription}>
{resource.description}
</div>
<Button
className={styles.productResourceCardButton}
onClick={() =>
openUrl({
href: resource.buttonLink,
target: resource.target,
})
}
>
{resource.buttonText}
</Button>
<Link to={resource.buttonLink} target={resource.target}>
<Button className={styles.productResourceCardButton}>
{resource.buttonText}
</Button>
</Link>
</div>
</Card>
))}
Expand Down

0 comments on commit 76ae0f5

Please sign in to comment.