Skip to content

Commit

Permalink
chore: allow ids on the card component
Browse files Browse the repository at this point in the history
  • Loading branch information
abaicus committed Jan 29, 2025
1 parent 2dc5d8c commit 02fe431
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/apps/dashboard/src/Components/Content/ModuleGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const ModuleCard = ({ moduleData, slug }) => {
title={nicename}
className="bg-white p-6 rounded-lg shadow-sm"
afterTitle={<ModuleToggle slug={slug} moduleData={moduleData} />}
data-module={slug}
id={`module-${slug}`}
>
<p className="text-gray-600 text-sm leading-relaxed">
{description}{' '}
Expand Down
11 changes: 9 additions & 2 deletions assets/apps/dashboard/src/Layout/Card.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import cn from 'classnames';

export default ({ icon, title, children, afterTitle, className = '' }) => {
export default ({
icon,
title,
children,
afterTitle,
className = '',
id = null,
}) => {
const classes = cn(
[
'p-6 rounded-lg shadow-sm',
Expand All @@ -12,7 +19,7 @@ export default ({ icon, title, children, afterTitle, className = '' }) => {
);

return (
<div className={classes}>
<div className={classes} id={id}>
{(icon || title) && (
<div className="flex items-center mb-6 gap-3">
{icon && (
Expand Down

0 comments on commit 02fe431

Please sign in to comment.