feat: add card ids
This commit is contained in:
@@ -7,15 +7,19 @@ import './index.scss';
|
||||
const baseClass = 'card';
|
||||
|
||||
const Card: React.FC<Props> = (props) => {
|
||||
const { title, actions, onClick } = props;
|
||||
const { id, title, actions, onClick } = props;
|
||||
|
||||
const classes = [
|
||||
baseClass,
|
||||
id,
|
||||
onClick && `${baseClass}--has-onclick`,
|
||||
].filter(Boolean).join(' ');
|
||||
|
||||
return (
|
||||
<div className={classes}>
|
||||
<div
|
||||
className={classes}
|
||||
id={id}
|
||||
>
|
||||
<h5>
|
||||
{title}
|
||||
</h5>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export type Props = {
|
||||
id?: string,
|
||||
title: string,
|
||||
actions?: React.ReactNode,
|
||||
onClick?: () => void,
|
||||
|
||||
@@ -47,6 +47,7 @@ const Dashboard: React.FC<Props> = (props) => {
|
||||
<li key={collection.slug}>
|
||||
<Card
|
||||
title={collection.labels.plural}
|
||||
id={`card-${collection.slug}`}
|
||||
onClick={() => push({ pathname: `${admin}/collections/${collection.slug}` })}
|
||||
actions={hasCreatePermission ? (
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user