docbrown/app/javascript/listings/dashboard/rowElements/actionButtons.jsx
ludwiczakpawel ea28093bbb
Implementing new buttons (#15843)
* buttons

* view archive link block

* revert font weight change

* save draft title

* revert

* fix

* specs

* specs

* spec

* spec

* for fcks  sake

* Change spec for unarchive/archive button from .find to .findByRole

* fix help icon

* improve a11y on close.jsx

* bring back the focus

* .

* Update cypress/integration/seededFlows/publishingFlows/uploadImage.spec.js

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

* drop icons.jsx

Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-01-14 10:28:31 +01:00

27 lines
644 B
JavaScript

import PropTypes from 'prop-types';
import { h } from 'preact';
import { Link } from '@crayons';
export const ActionButtons = ({ isDraft, editUrl, deleteConfirmUrl }) => {
return (
<div className="listing-row-actions flex">
{isDraft && (
<Link block href={editUrl}>
View draft
</Link>
)}
<Link block href={editUrl}>
Edit
</Link>
<Link block href={deleteConfirmUrl}>
Delete
</Link>
</div>
);
};
ActionButtons.propTypes = {
isDraft: PropTypes.bool.isRequired,
editUrl: PropTypes.string.isRequired,
deleteConfirmUrl: PropTypes.string.isRequired,
};