Fix missing icon props (#27539)
This commit is contained in:
parent
bc3afb6311
commit
f08ca3f042
|
@ -25,7 +25,9 @@ export const Icon: React.FC<Props> = ({
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||||
if (!IconComponent) {
|
if (!IconComponent) {
|
||||||
if (process.env.NODE_ENV !== 'production') {
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
throw new Error(`<Icon id="${id}"> is missing an "icon" prop.`);
|
throw new Error(
|
||||||
|
`<Icon id="${id}" className="${className}"> is missing an "icon" prop.`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
IconComponent = CheckBoxOutlineBlankIcon;
|
IconComponent = CheckBoxOutlineBlankIcon;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
|
import { ReactComponent as PersonAddIcon } from '@material-symbols/svg-600/outlined/person_add.svg';
|
||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
|
|
||||||
import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts';
|
import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts';
|
||||||
|
@ -67,7 +68,7 @@ class FollowRequests extends ImmutablePureComponent {
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column bindToDocument={!multiColumn} icon='user-plus' heading={intl.formatMessage(messages.heading)}>
|
<Column bindToDocument={!multiColumn} icon='user-plus' iconComponent={PersonAddIcon} heading={intl.formatMessage(messages.heading)}>
|
||||||
<ColumnBackButtonSlim />
|
<ColumnBackButtonSlim />
|
||||||
<ScrollableList
|
<ScrollableList
|
||||||
scrollKey='follow_requests'
|
scrollKey='follow_requests'
|
||||||
|
|
|
@ -9,6 +9,7 @@ export default class ColumnHeader extends PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
icon: PropTypes.string,
|
icon: PropTypes.string,
|
||||||
|
iconComponent: PropTypes.func,
|
||||||
type: PropTypes.string,
|
type: PropTypes.string,
|
||||||
active: PropTypes.bool,
|
active: PropTypes.bool,
|
||||||
onClick: PropTypes.func,
|
onClick: PropTypes.func,
|
||||||
|
@ -20,11 +21,11 @@ export default class ColumnHeader extends PureComponent {
|
||||||
};
|
};
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { icon, type, active, columnHeaderId } = this.props;
|
const { icon, iconComponent, type, active, columnHeaderId } = this.props;
|
||||||
let iconElement = '';
|
let iconElement = '';
|
||||||
|
|
||||||
if (icon) {
|
if (icon) {
|
||||||
iconElement = <Icon id={icon} className='column-header__icon' />;
|
iconElement = <Icon id={icon} icon={iconComponent} className='column-header__icon' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue