Replace <a> and <button> with <PlainButton> (#5433)

* Add PlainButton

* refactor close icons

* reorder import

* refactor remaining anchors

* refactor: replace remaining <button> and TODOs

* refactor: changed applicable elements to type link

* fix: minor details

* bug: fix tooltip ternary

* refactor: improve interactivity and semantics of schema list item
This commit is contained in:
Rafael Wendel
2021-04-10 16:43:58 -03:00
committed by GitHub
parent 23ced5db50
commit d8d7c78992
28 changed files with 231 additions and 176 deletions

View File

@@ -3,6 +3,7 @@ import PropTypes from "prop-types";
import Dropdown from "antd/lib/dropdown";
import Menu from "antd/lib/menu";
import Button from "antd/lib/button";
import PlainButton from "@/components/PlainButton";
import { clientConfig } from "@/services/auth";
import PlusCircleFilledIcon from "@ant-design/icons/PlusCircleFilled";
@@ -18,16 +19,18 @@ export default function QueryControlDropdown(props) {
<Menu>
{!props.query.isNew() && (!props.query.is_draft || !props.query.is_archived) && (
<Menu.Item>
<a target="_self" onClick={() => props.openAddToDashboardForm(props.selectedTab)}>
<PlainButton onClick={() => props.openAddToDashboardForm(props.selectedTab)}>
<PlusCircleFilledIcon /> Add to Dashboard
</a>
</PlainButton>
</Menu.Item>
)}
{!clientConfig.disablePublicUrls && !props.query.isNew() && (
<Menu.Item>
<a onClick={() => props.showEmbedDialog(props.query, props.selectedTab)} data-test="ShowEmbedDialogButton">
<PlainButton
onClick={() => props.showEmbedDialog(props.query, props.selectedTab)}
data-test="ShowEmbedDialogButton">
<ShareAltOutlinedIcon /> Embed Elsewhere
</a>
</PlainButton>
</Menu.Item>
)}
<Menu.Item>