mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-25 00:11:36 +01:00
Allow adding classes to DownloadButton
This commit is contained in:
parent
fd01bc6f56
commit
1064277cd9
|
@ -10,12 +10,25 @@ import PropTypes from "prop-types";
|
||||||
|
|
||||||
DownloadButton.propTypes = {
|
DownloadButton.propTypes = {
|
||||||
href: PropTypes.string.isRequired,
|
href: PropTypes.string.isRequired,
|
||||||
|
className: PropTypes.string,
|
||||||
children: PropTypes.oneOfType([
|
children: PropTypes.oneOfType([
|
||||||
PropTypes.arrayOf(PropTypes.node),
|
PropTypes.arrayOf(PropTypes.node),
|
||||||
PropTypes.node,
|
PropTypes.node,
|
||||||
]),
|
]),
|
||||||
};
|
};
|
||||||
|
|
||||||
export function DownloadButton({ href, children }) {
|
DownloadButton.defaultProps = {
|
||||||
return <a href={href} className="btn btn-primary" download>{children}</a>;
|
className: "btn-primary",
|
||||||
|
};
|
||||||
|
|
||||||
|
export function DownloadButton({ href, className, children }) {
|
||||||
|
return (
|
||||||
|
<a
|
||||||
|
href={href}
|
||||||
|
className={`btn ${className}`.trim()}
|
||||||
|
download
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</a>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user