1
0
Fork 0
forked from gitea/nas

Fix: #184 アンテナ編集画面のアイコン (#187)

This commit is contained in:
KMY(雪あすか) 2023-10-27 10:31:36 +09:00 committed by GitHub
parent 8ef161760d
commit c20a882b59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 5 deletions

View file

@ -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}>