Remove usage of deprecated defaultTypes on React functional components (#30099)

This commit is contained in:
Renaud Chaput 2024-04-29 11:29:59 +02:00 committed by GitHub
parent 2739d8d5a4
commit b9b4db483c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,7 @@ import PersonIcon from '@/material-icons/400-24px/person.svg?react';
import SmartToyIcon from '@/material-icons/400-24px/smart_toy.svg?react';
export const Badge = ({ icon, label, domain, roleId }) => (
export const Badge = ({ icon = <PersonIcon />, label, domain, roleId }) => (
<div className='account-role' data-account-role-id={roleId}>
{icon}
{label}
@ -22,10 +22,6 @@ Badge.propTypes = {
roleId: PropTypes.string
};
Badge.defaultProps = {
icon: <PersonIcon />,
};
export const GroupBadge = () => (
<Badge icon={<GroupsIcon />} label={<FormattedMessage id='account.badges.group' defaultMessage='Group' />} />
);