Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore)MC-1676: CardActionButtonRow component refactor #1234

Merged
merged 4 commits into from
Mar 20, 2025

Conversation

katerinachinnappan
Copy link
Contributor

@katerinachinnappan katerinachinnappan commented Mar 19, 2025

Goal

Abstract the CardActionButtonRow component to be more generic & not need to know about all card button actions across different component.

  • Added new CardAction type to take in the action name, MUI icon & onClick callback.
  • Adjusted CardActionButtonRowProps to take an array of (optional) right-aligned CardAction & (optional) left-aligned CardAction.

Components can now specify right and/or left card action buttons like this:

  // card action buttons to be rendered & aligned on bottom left
  const cardActionButtonsLeft: CardAction[] = [
    { actionName: 'Edit', icon: <EditOutlinedIcon />, onClick: () => onEdit() },
  ];
  // card action buttons to be rendered & aligned on bottom right
  const cardActionButtonsRight: CardAction[] = [
    { actionName: 'Remove', icon: <ClearIcon />, onClick: () => onRemove() },
  ];

<CardActionButtonRow
    cardActionButtonsLeft={cardActionButtonsLeft}
    cardActionButtonsRight={cardActionButtonsRight}
/>

Todos

  • deploy to dev

Reference

Tickets:

@katerinachinnappan katerinachinnappan requested a review from a team as a code owner March 19, 2025 21:11
Copy link
Collaborator

@jpetto jpetto left a comment

Choose a reason for hiding this comment

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

this is great! nice work!

@katerinachinnappan katerinachinnappan merged commit fcb47f9 into main Mar 20, 2025
10 checks passed
@katerinachinnappan katerinachinnappan deleted the katerina/MC-1676-refactor-CardActionButton branch March 20, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants