Skip to content

Commit

Permalink
Remove usage of deprecated defaultTypes on React functional compone…
Browse files Browse the repository at this point in the history
  • Loading branch information
renchap committed Apr 29, 2024
1 parent 2739d8d commit b9b4db4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/javascript/mastodon/components/badge.jsx
Expand Up @@ -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}
Expand All @@ -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' />} />
);
Expand Down

0 comments on commit b9b4db4

Please sign in to comment.