X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/eb4491eea9ba873845f7a5796d139d19977f8112..69a0ab3baf5ae7d1f5abc429831f0261ac8ecc05:/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 755cc67c26..6812535def 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,24 @@ 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; className?: string; } & WithStyles<CssRules>) => {
+        if (props.isFavoriteVisible) {
+            return <FavoriteIcon className={props.className || props.classes.icon} />;
+        } else {
+            return null;
+        }
+    }));
+
+export const PublicFavoriteStar = connect(mapStateToProps)(
+    withStyles(styles)((props: { isPublicFavoriteVisible: boolean; className?: string; } & WithStyles<CssRules>) => {
+        if (props.isPublicFavoriteVisible) {
+            return <PublicFavoriteIcon className={props.className || props.classes.icon} />;
+        } else {
+            return null;
+        }
+    }));
