Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix accessibility issues #6778

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading