Implement Save without re-prompt and Save as (#1709)

* Implement Save without re-prompt and Save as
Fixes #1668

* Add save-as icon

* Make .excalidraw the default extension

* Only show save as button on supporting browsers
This commit is contained in:
Thomas Steiner 2020-06-12 18:35:04 +02:00 committed by GitHub
parent 0ed6a96b6a
commit 5d3867d8ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 74 additions and 26 deletions

View file

@ -16,6 +16,7 @@ type ToolButtonBaseProps = {
size?: ToolIconSize;
keyBindingLabel?: string;
showAriaLabel?: boolean;
hidden?: boolean;
visible?: boolean;
selected?: boolean;
className?: string;
@ -44,13 +45,16 @@ export const ToolButton = React.forwardRef((props: ToolButtonProps, ref) => {
if (props.type === "button") {
return (
<button
className={`ToolIcon_type_button ToolIcon ${sizeCn}${
props.selected ? " ToolIcon--selected" : ""
} ${props.className} ${
props.visible
className={`ToolIcon_type_button ${
!props.hidden ? "ToolIcon" : ""
} ${sizeCn}${props.selected ? " ToolIcon--selected" : ""} ${
props.className
} ${
props.visible && !props.hidden
? "ToolIcon_type_button--show"
: "ToolIcon_type_button--hide"
}`}
hidden={props.hidden}
title={props.title}
aria-label={props["aria-label"]}
type="button"