add reset button

This commit is contained in:
Sanster 2022-02-06 21:40:49 +08:00
parent b4dc7a0253
commit 0814b07ef9
2 changed files with 13 additions and 4 deletions

View File

@ -1,4 +1,8 @@
import { DownloadIcon, EyeIcon } from '@heroicons/react/outline' import {
ArrowsExpandIcon,
DownloadIcon,
EyeIcon,
} from '@heroicons/react/outline'
import React, { import React, {
SyntheticEvent, SyntheticEvent,
useCallback, useCallback,
@ -591,6 +595,12 @@ export default function Editor(props: EditorProps) {
onChange={setBrushSize} onChange={setBrushSize}
/> />
<div> <div>
<Button
className="mr-2"
icon={<ArrowsExpandIcon className="w-6 h-6" />}
disabled={scale === minScale}
onClick={resetZoom}
/>
<Button <Button
className="mr-2" className="mr-2"
icon={ icon={
@ -629,7 +639,6 @@ export default function Editor(props: EditorProps) {
</Button> </Button>
<Button <Button
primary
icon={<DownloadIcon className="w-6 h-6" />} icon={<DownloadIcon className="w-6 h-6" />}
disabled={!renders.length} disabled={!renders.length}
onClick={download} onClick={download}
@ -642,7 +651,7 @@ export default function Editor(props: EditorProps) {
className="absolute bg-black backdrop-blur backdrop-filter bg-opacity-10 rounded-xl" className="absolute bg-black backdrop-blur backdrop-filter bg-opacity-10 rounded-xl"
style={{ style={{
height: '58px', height: '58px',
width: '680px', width: '700px',
zIndex: -1, zIndex: -1,
marginLeft: '-1px', marginLeft: '-1px',
}} }}

View File

@ -50,7 +50,7 @@ export default function Button(props: ButtonProps) {
}} }}
tabIndex={-1} tabIndex={-1}
className={[ className={[
'inline-flex py-3 px-5 rounded-md cursor-pointer', 'inline-flex py-3 px-3 rounded-md cursor-pointer',
children ? 'space-x-3' : '', children ? 'space-x-3' : '',
background, background,
disabled ? 'pointer-events-none opacity-50' : '', disabled ? 'pointer-events-none opacity-50' : '',