Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/components/shared/Button/Close.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { DOM as dom, PropTypes } from "react";
import React, { PropTypes } from "react";
import Svg from "../Svg";
import "./Close.css";

Expand All @@ -10,16 +10,18 @@ type CloseButtonType = {
};

function CloseButton({ handleClick, buttonClass, tooltip }: CloseButtonType) {
return dom.div(
{
className: buttonClass ? `close-btn ${buttonClass}` : "close-btn",
onClick: handleClick,
title: tooltip
},
Svg("close")
return (
<div
className={buttonClass ? `close-btn ${buttonClass}` : "close-btn"}
onClick={handleClick}
title={tooltip}
>
{Svg("close")}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated but it'd be nice to update Svg to take a name prop and then we could have these calls be JSX too.

</div>
);
}

CloseButton.displayName = "CloseButton";
CloseButton.propTypes = {
handleClick: PropTypes.func.isRequired
};
Expand Down