From f94f95e78874c3536c8bdb3ec461acd20cf26d9b Mon Sep 17 00:00:00 2001 From: Tanuj Mittal Date: Wed, 14 Apr 2021 16:57:04 -0700 Subject: [PATCH] Hide favorite button from Standalone gallery (#675) --- .../GalleryViewerComponent.tsx | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/Explorer/Controls/NotebookGallery/GalleryViewerComponent.tsx b/src/Explorer/Controls/NotebookGallery/GalleryViewerComponent.tsx index 3435b779c..2831ec866 100644 --- a/src/Explorer/Controls/NotebookGallery/GalleryViewerComponent.tsx +++ b/src/Explorer/Controls/NotebookGallery/GalleryViewerComponent.tsx @@ -21,18 +21,18 @@ import { Text, } from "office-ui-fabric-react"; import * as React from "react"; +import { HttpStatusCodes } from "../../../Common/Constants"; +import { handleError } from "../../../Common/ErrorHandlingUtils"; import { IGalleryItem, IJunoResponse, IPublicGalleryData, JunoClient } from "../../../Juno/JunoClient"; +import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants"; +import { trace } from "../../../Shared/Telemetry/TelemetryProcessor"; import * as GalleryUtils from "../../../Utils/GalleryUtils"; +import Explorer from "../../Explorer"; import { Dialog, DialogProps } from "../Dialog"; import { GalleryCardComponent, GalleryCardComponentProps } from "./Cards/GalleryCardComponent"; -import "./GalleryViewerComponent.less"; -import { HttpStatusCodes } from "../../../Common/Constants"; -import Explorer from "../../Explorer"; import { CodeOfConductComponent } from "./CodeOfConductComponent"; +import "./GalleryViewerComponent.less"; import { InfoComponent } from "./InfoComponent/InfoComponent"; -import { handleError } from "../../../Common/ErrorHandlingUtils"; -import { trace } from "../../../Shared/Telemetry/TelemetryProcessor"; -import { Action, ActionModifiers } from "../../../Shared/Telemetry/TelemetryConstants"; export interface GalleryViewerComponentProps { container?: Explorer; @@ -138,11 +138,11 @@ export class GalleryViewerComponent extends React.Component { - const isFavorite = this.favoriteNotebooks?.find((item) => item.id === data.id) !== undefined; + const isFavorite = + this.props.container && this.favoriteNotebooks?.find((item) => item.id === data.id) !== undefined; const props: GalleryCardComponentProps = { data, isFavorite,