X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/876e5e2f31a218255845977489ea70aacc0211cd..5a84b3bf9b7bf9a1d07e9595b2453c4133ffd23d:/src/views-components/favorite-star/favorite-star.tsx

diff --git a/src/views-components/favorite-star/favorite-star.tsx b/src/views-components/favorite-star/favorite-star.tsx
index 755cc67c..cf744886 100644
--- a/src/views-components/favorite-star/favorite-star.tsx
+++ b/src/views-components/favorite-star/favorite-star.tsx
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import * as React from "react";
-import { FavoriteIcon } from "~/components/icon/icon";
+import { FavoriteIcon, PublicFavoriteIcon } from "~/components/icon/icon";
 import { connect } from "react-redux";
 import { RootState } from "~/store/store";
 import { withStyles, StyleRulesCallback, WithStyles } from "@material-ui/core";
@@ -18,10 +18,17 @@ const styles: StyleRulesCallback<CssRules> = theme => ({
 
 const mapStateToProps = (state: RootState, props: { resourceUuid: string; className?: string; }) => ({
     ...props,
-    visible: state.favorites[props.resourceUuid],
+    isFavoriteVisible: state.favorites[props.resourceUuid],
+    isPublicFavoriteVisible: state.publicFavorites[props.resourceUuid]
 });
 
 export const FavoriteStar = connect(mapStateToProps)(
-    withStyles(styles)((props: { visible: boolean; className?: string; } & WithStyles<CssRules>) =>
-        props.visible ? <FavoriteIcon className={props.className || props.classes.icon} /> : null
-    ));
+    withStyles(styles)((props: { isFavoriteVisible: boolean; isPublicFavoriteVisible: boolean; className?: string; } & WithStyles<CssRules>) => {
+        if (props.isPublicFavoriteVisible) {
+            return <PublicFavoriteIcon className={props.className || props.classes.icon} />;
+        } else if (props.isFavoriteVisible) {
+            return <FavoriteIcon className={props.className || props.classes.icon} />;
+        } else {
+            return null;
+        }
+    }));
