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

[material-ui][AvatarGroup] Add renderSurplus prop #39283

Merged
merged 9 commits into from
Oct 11, 2023

Conversation

uuxxx
Copy link
Contributor

@uuxxx uuxxx commented Oct 3, 2023

…Avatar element

According to @siriwatknp comment, add renderSurplus prop.
possible solution to #39204

@mui-bot
Copy link

mui-bot commented Oct 3, 2023

Netlify deploy preview

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against f9c2770

@zannager zannager added the component: avatar This is the name of the generic UI component, not the React module! label Oct 3, 2023
@zannager zannager requested a review from siriwatknp October 3, 2023 12:41
@danilo-leal danilo-leal changed the title [mui-material][AvatarGroup] Add renderSurplus prop to customize extra… [material-ui][AvatarGroup] Add renderSurplus prop Oct 3, 2023
@danilo-leal danilo-leal added package: material-ui Specific to @mui/material enhancement This is not a bug, nor a new feature labels Oct 3, 2023
@siriwatknp
Copy link
Member

siriwatknp commented Oct 9, 2023

The code looks good to me! let's add a demo next to https://mui.com/material-ui/react-avatar/#total-avatars

### Custom surplus

Set `renderSurplus` prop as a callback to customize the surplus avatar. The callback will receive one argument which is the number of surpluses based on the children and `max` prop.

This is useful when you need to render the surplus based on the data sent from the server.

// demo

@uuxxx
Copy link
Contributor Author

uuxxx commented Oct 9, 2023

@siriwatknp done

@siriwatknp siriwatknp requested a review from DiegoAndai October 10, 2023 11:55
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

👍 Looks good! thanks for your contribution.

Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

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

Hey @uuxxx! thanks for working on this

I left two writing improvements and a question, let me know what you think 😊

docs/data/material/components/avatars/avatars.md Outdated Show resolved Hide resolved
docs/data/material/components/avatars/avatars.md Outdated Show resolved Hide resolved
packages/mui-material/src/AvatarGroup/AvatarGroup.d.ts Outdated Show resolved Hide resolved
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for working on it!

@DiegoAndai DiegoAndai merged commit a3b75df into mui:master Oct 11, 2023
9 checks passed
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Oct 13, 2023
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Oct 13, 2023
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: avatar This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants