[Glitch] Remove usage of deprecated `defaultTypes` on React functional components
Port b9b4db483c
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
main
parent
f09f5b35f2
commit
e62595c966
|
@ -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';
|
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}>
|
<div className='account-role' data-account-role-id={roleId}>
|
||||||
{icon}
|
{icon}
|
||||||
{label}
|
{label}
|
||||||
|
@ -22,10 +22,6 @@ Badge.propTypes = {
|
||||||
roleId: PropTypes.string
|
roleId: PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
Badge.defaultProps = {
|
|
||||||
icon: <PersonIcon />,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const GroupBadge = () => (
|
export const GroupBadge = () => (
|
||||||
<Badge icon={<GroupsIcon />} label={<FormattedMessage id='account.badges.group' defaultMessage='Group' />} />
|
<Badge icon={<GroupsIcon />} label={<FormattedMessage id='account.badges.group' defaultMessage='Group' />} />
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue