X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3ee31ce16470660d90fb870e048c2de9fcde6e47..44821dc84765936ce99fa2d760ef683281f0a578:/src/views-components/context-menu/actions/favorite-action.tsx

diff --git a/src/views-components/context-menu/actions/favorite-action.tsx b/src/views-components/context-menu/actions/favorite-action.tsx
index 05e03fb34b..b7e7dd6246 100644
--- a/src/views-components/context-menu/actions/favorite-action.tsx
+++ b/src/views-components/context-menu/actions/favorite-action.tsx
@@ -2,26 +2,29 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
-import { ListItemIcon, ListItemText } from "@material-ui/core";
-import { AddFavoriteIcon, RemoveFavoriteIcon } from "../../../components/icon/icon";
+import React from "react";
+import { ListItemIcon, ListItemText, ListItem } from "@material-ui/core";
+import { AddFavoriteIcon, RemoveFavoriteIcon } from "components/icon/icon";
 import { connect } from "react-redux";
-import { RootState } from "../../../store/store";
+import { RootState } from "store/store";
 
-const mapStateToProps = (state: RootState) => ({
-    isFavorite: state.contextMenu.resource && state.favorites[state.contextMenu.resource.uuid] === true
+const mapStateToProps = (state: RootState, props: { onClick: () => {} }) => ({
+    isFavorite: state.contextMenu.resource !== undefined && state.favorites[state.contextMenu.resource.uuid] === true,
+    onClick: props.onClick
 });
 
-export const ToggleFavoriteAction = connect(mapStateToProps)((props: { isFavorite: boolean }) =>
-    <>
+export const ToggleFavoriteAction = connect(mapStateToProps)((props: { isFavorite: boolean, onClick: () => void }) =>
+    <ListItem
+        button
+        onClick={props.onClick}>
         <ListItemIcon>
             {props.isFavorite
                 ? <RemoveFavoriteIcon />
                 : <AddFavoriteIcon />}
         </ListItemIcon>
-        <ListItemText>
+        <ListItemText style={{ textDecoration: 'none' }}>
             {props.isFavorite
                 ? <>Remove from favorites</>
                 : <>Add to favorites</>}
         </ListItemText>
-    </>);
+    </ListItem >);
