Show labels instead of icons for PNG, SVG (#606)

This commit is contained in:
Lipis 2020-01-29 02:30:03 +02:00 committed by GitHub
parent a9790c74f5
commit 2dce2ce712
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 23 deletions

View file

@ -5,9 +5,10 @@ import React from "react";
type ToolIconSize = "s" | "m";
type ToolButtonBaseProps = {
icon: React.ReactNode;
icon?: React.ReactNode;
"aria-label": string;
"aria-keyshortcuts"?: string;
label?: string;
title?: string;
name?: string;
id?: string;
@ -44,7 +45,7 @@ export const ToolButton = React.forwardRef(function(
ref={innerRef}
>
<div className="ToolIcon__icon" aria-hidden="true">
{props.icon}
{props.icon || props.label}
</div>
</button>
);