From 61cd47a0e75af9ac06b252f719e56e2dc31dc3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Mon, 18 May 2020 20:18:48 +0200 Subject: [PATCH] fix: convert variant-view-component to function --- .../variant/variant-view-component.jsx | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/frontend/src/component/feature/variant/variant-view-component.jsx b/frontend/src/component/feature/variant/variant-view-component.jsx index 66004a3636..2d0ad8b0e1 100644 --- a/frontend/src/component/feature/variant/variant-view-component.jsx +++ b/frontend/src/component/feature/variant/variant-view-component.jsx @@ -1,28 +1,25 @@ -import React, { Component } from 'react'; +import React from 'react'; import PropTypes from 'prop-types'; import { IconButton } from 'react-mdl'; import styles from './variant.scss'; import { UPDATE_FEATURE } from '../../../permissions'; -class VariantViewComponent extends Component { - render() { - const { variant, editVariant, removeVariant, hasPermission } = this.props; - return ( - - {variant.name} - {variant.weight} - {hasPermission(UPDATE_FEATURE) ? ( - - - - - ) : ( - - )} - - ); - } +function VariantViewComponent({ variant, editVariant, removeVariant, hasPermission }) { + return ( + + {variant.name} + {variant.weight} + {hasPermission(UPDATE_FEATURE) ? ( + + + + + ) : ( + + )} + + ); } VariantViewComponent.propTypes = {