docs: increase the response range of button click on mobile

This commit is contained in:
unix
2020-03-24 03:51:29 +08:00
parent 84e8072b38
commit ee05d0dc8e

View File

@@ -1,20 +1,22 @@
import React from 'react'
import { useTheme } from 'components'
import { Button, useTheme } from 'components'
import ToggleIcon from '../icons/toggle'
interface Props {
onClick?: (e: React.MouseEvent<SVGElement>) => void
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void
}
const TabbarMobile:React.FC<Props> = ({ onClick }) => {
const theme = useTheme()
const handler = (event: React.MouseEvent<SVGElement>) => {
const handler = (event: React.MouseEvent<HTMLButtonElement>) => {
onClick && onClick(event)
}
return (
<div className="tabbar">
<ToggleIcon color={theme.palette.accents_7} onClick={handler} />
<Button className="toggle" auto type="abort" onClick={handler}>
<ToggleIcon color={theme.palette.accents_7} />
</Button>
<span>ZEIT-UI React</span>
<style jsx>{`
.tabbar {
@@ -33,6 +35,15 @@ const TabbarMobile:React.FC<Props> = ({ onClick }) => {
box-shadow: ${theme.expressiveness.shadowMedium};
}
.tabbar :global(.toggle) {
width: 40px;
height: 40px;
padding: 0;
display: inline-flex;
justify-content: center;
align-items: center;
}
span {
color: ${theme.palette.accents_7};
font-size: .75rem;