|
@@ -1,7 +1,7 @@
|
|
|
import cx from 'classnames';
|
|
|
import React, { MouseEvent } from 'react';
|
|
|
-import styles from './calorieRow.css';
|
|
|
import { ItemActions } from './ItemActions';
|
|
|
+import styles from './calorieRow.scss';
|
|
|
|
|
|
type CalorieRowProps = {
|
|
|
item: CalorieValue,
|
|
@@ -25,14 +25,20 @@ function CalorieRow (props: CalorieRowProps) {
|
|
|
|
|
|
return (
|
|
|
<div className={cx(styles.calorieRow, {[styles.selected]: isSelected})} {...{onClick}}>
|
|
|
- <div className="itemValues">
|
|
|
+ <ItemActions {...{
|
|
|
+ className: cx(
|
|
|
+ styles.itemActions,
|
|
|
+ {
|
|
|
+ [styles.open]: isSelected
|
|
|
+ }
|
|
|
+ ),
|
|
|
+ removeItem: () => removeItem(item)
|
|
|
+ }} />
|
|
|
+
|
|
|
+ <div className={styles.itemValues}>
|
|
|
<div className={styles.title}>{item.title}</div>
|
|
|
<div>{item.count}</div>
|
|
|
</div>
|
|
|
-
|
|
|
- { isSelected && (
|
|
|
- <ItemActions {...{removeItem: () => removeItem(item)}} />
|
|
|
- )}
|
|
|
</div>
|
|
|
);
|
|
|
}
|