by default show undo and check original button

This commit is contained in:
Sanster 2022-02-05 21:50:01 +08:00
parent 8eeb350f49
commit 8013fc554f

View File

@ -418,9 +418,9 @@ export default function Editor(props: EditorProps) {
value={brushSize} value={brushSize}
onChange={setBrushSize} onChange={setBrushSize}
/> />
{renders.length ? ( <div>
<>
<Button <Button
className="mr-2"
icon={ icon={
<svg <svg
width="19" width="19"
@ -437,8 +437,10 @@ export default function Editor(props: EditorProps) {
</svg> </svg>
} }
onClick={undo} onClick={undo}
disabled={renders.length === 0}
/> />
<Button <Button
className="mr-2"
icon={<EyeIcon className="w-6 h-6" />} icon={<EyeIcon className="w-6 h-6" />}
onDown={ev => { onDown={ev => {
ev.preventDefault() ev.preventDefault()
@ -449,13 +451,10 @@ export default function Editor(props: EditorProps) {
setShowOriginal(false) setShowOriginal(false)
setTimeout(() => setShowSeparator(false), 300) setTimeout(() => setShowSeparator(false), 300)
}} }}
disabled={renders.length === 0}
> >
{windowSize.width > 640 ? 'Original' : undefined} {undefined}
</Button> </Button>
</>
) : (
<></>
)}
<Button <Button
primary primary
@ -463,9 +462,10 @@ export default function Editor(props: EditorProps) {
disabled={!renders.length} disabled={!renders.length}
onClick={download} onClick={download}
> >
{windowSize.width > 640 ? 'Download' : undefined} {undefined}
</Button> </Button>
</div> </div>
</div> </div>
</div>
) )
} }