From f462da5224589d52620121df7b39f3c0ed9bbbb1 Mon Sep 17 00:00:00 2001 From: sveisvei Date: Sat, 10 Dec 2016 14:02:41 +0100 Subject: [PATCH] fix getIcon --- frontend/src/component/common/index.js | 11 ++++++++++- .../src/component/feature/view-edit-container.jsx | 3 +-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/component/common/index.js b/frontend/src/component/common/index.js index 168fc27066..d5677371ee 100644 --- a/frontend/src/component/common/index.js +++ b/frontend/src/component/common/index.js @@ -1,7 +1,6 @@ const React = require('react'); const { List, ListItem, ListItemContent, - Grid, Cell, Button, Icon, Switch, } = require('react-mdl'); @@ -70,3 +69,13 @@ export const TogglesLinkList = ({ toggles }) => ( ))} ); + +export function getIcon (type) { + switch (type) { + case 'feature-updated': return 'autorenew'; + case 'feature-created': return 'add'; + case 'feature-deleted': return 'remove'; + case 'feature-archived': return 'archived'; + default: return 'star'; + } +}; diff --git a/frontend/src/component/feature/view-edit-container.jsx b/frontend/src/component/feature/view-edit-container.jsx index 9551ee28d4..111fdc96fe 100644 --- a/frontend/src/component/feature/view-edit-container.jsx +++ b/frontend/src/component/feature/view-edit-container.jsx @@ -10,9 +10,8 @@ import EditFeatureToggle from './form-edit-container.jsx'; import { fetchFeatureToggles, toggleFeature } from '../../store/feature-actions'; import { fetchFeatureMetrics, fetchSeenApps } from '../../store/feature-metrics-actions'; import { fetchHistoryForToggle } from '../../store/history-actions'; -import { getIcon } from '../history/history-item-diff'; -import { AppsLinkList, SwitchWithLabel } from '../common'; +import { AppsLinkList, SwitchWithLabel, getIcon } from '../common'; class EditFeatureToggleWrapper extends React.Component {