parent
8ef161760d
commit
c20a882b59
2 changed files with 18 additions and 5 deletions
|
@ -6,6 +6,8 @@ import { injectIntl } from 'react-intl';
|
|||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { ReactComponent as DeleteIcon } from '@material-symbols/svg-600/outlined/delete.svg';
|
||||
|
||||
import { Button } from 'mastodon/components/button';
|
||||
import { Icon } from 'mastodon/components/icon';
|
||||
import { IconButton } from 'mastodon/components/icon_button';
|
||||
|
@ -14,6 +16,7 @@ class TextListItem extends PureComponent {
|
|||
|
||||
static propTypes = {
|
||||
icon: PropTypes.string.isRequired,
|
||||
iconComponent: PropTypes.object.isRequired,
|
||||
value: PropTypes.string.isRequired,
|
||||
onRemove: PropTypes.func.isRequired,
|
||||
};
|
||||
|
@ -23,13 +26,13 @@ class TextListItem extends PureComponent {
|
|||
};
|
||||
|
||||
render () {
|
||||
const { icon, value } = this.props;
|
||||
const { icon, iconComponent, value } = this.props;
|
||||
|
||||
return (
|
||||
<div className='setting-text-list-item'>
|
||||
<Icon id={icon} />
|
||||
<Icon id={icon} icon={iconComponent} />
|
||||
<span className='label'>{value}</span>
|
||||
<IconButton icon='trash' onClick={this.handleRemove} />
|
||||
<IconButton icon='trash' iconComponent={DeleteIcon} onClick={this.handleRemove} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -44,6 +47,7 @@ class TextList extends PureComponent {
|
|||
disabled: PropTypes.bool,
|
||||
intl: PropTypes.object.isRequired,
|
||||
icon: PropTypes.string.isRequired,
|
||||
iconComponent: PropTypes.object.isRequired,
|
||||
label: PropTypes.string.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
|
@ -65,12 +69,12 @@ class TextList extends PureComponent {
|
|||
};
|
||||
|
||||
render () {
|
||||
const { icon, value, values, disabled, label, title } = this.props;
|
||||
const { icon, iconComponent, value, values, disabled, label, title } = this.props;
|
||||
|
||||
return (
|
||||
<div className='setting-text-list'>
|
||||
{values.map((val) => (
|
||||
<TextListItem key={val} value={val} icon={icon} onRemove={this.props.onRemove} />
|
||||
<TextListItem key={val} value={val} icon={icon} iconComponent={iconComponent} onRemove={this.props.onRemove} />
|
||||
))}
|
||||
|
||||
<form className='add-text-form' onSubmit={this.handleSubmit}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue