mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-15 17:50:48 +02:00
fix: convert variant-view-component to function
This commit is contained in:
parent
d4e2296fda
commit
61cd47a0e7
@ -1,28 +1,25 @@
|
|||||||
import React, { Component } from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { IconButton } from 'react-mdl';
|
import { IconButton } from 'react-mdl';
|
||||||
import styles from './variant.scss';
|
import styles from './variant.scss';
|
||||||
import { UPDATE_FEATURE } from '../../../permissions';
|
import { UPDATE_FEATURE } from '../../../permissions';
|
||||||
|
|
||||||
class VariantViewComponent extends Component {
|
function VariantViewComponent({ variant, editVariant, removeVariant, hasPermission }) {
|
||||||
render() {
|
return (
|
||||||
const { variant, editVariant, removeVariant, hasPermission } = this.props;
|
<tr>
|
||||||
return (
|
<td onClick={editVariant}>{variant.name}</td>
|
||||||
<tr>
|
<td>{variant.weight}</td>
|
||||||
<td onClick={editVariant}>{variant.name}</td>
|
{hasPermission(UPDATE_FEATURE) ? (
|
||||||
<td>{variant.weight}</td>
|
<td className={styles.actions}>
|
||||||
{hasPermission(UPDATE_FEATURE) ? (
|
<IconButton name="expand_more" onClick={editVariant} />
|
||||||
<td className={styles.actions}>
|
<IconButton name="delete" onClick={removeVariant} />
|
||||||
<IconButton name="expand_more" onClick={editVariant} />
|
</td>
|
||||||
<IconButton name="delete" onClick={removeVariant} />
|
) : (
|
||||||
</td>
|
<td className={styles.actions} />
|
||||||
) : (
|
)}
|
||||||
<td className={styles.actions} />
|
</tr>
|
||||||
)}
|
);
|
||||||
</tr>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VariantViewComponent.propTypes = {
|
VariantViewComponent.propTypes = {
|
||||||
|
Loading…
Reference in New Issue
Block a user