From 944a901348e792b56a98a9afac70de5fe9de4980 Mon Sep 17 00:00:00 2001 From: Patricio Marroquin <55117912+patricio0312rev@users.noreply.github.com> Date: Fri, 17 Nov 2023 09:00:21 -0500 Subject: [PATCH] fix: do not disable create gallery button on gallery overview page (#470) --- .../Pages/Galleries/Components/GalleryGuestBanner/index.tsx | 4 +--- resources/js/Pages/Galleries/Index.tsx | 1 - .../Galleries/MyGalleries/Components/CreateGalleryButton.tsx | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/resources/js/Pages/Galleries/Components/GalleryGuestBanner/index.tsx b/resources/js/Pages/Galleries/Components/GalleryGuestBanner/index.tsx index 38a063663..a9d529541 100644 --- a/resources/js/Pages/Galleries/Components/GalleryGuestBanner/index.tsx +++ b/resources/js/Pages/Galleries/Components/GalleryGuestBanner/index.tsx @@ -7,10 +7,9 @@ import { CreateGalleryButton } from "@/Pages/Galleries/MyGalleries/Components/Cr interface Properties extends Pick { onClick?: () => void; - nftsCount?: number; } -const GalleryGuestBanner = ({ initialized, connecting, onClick, nftsCount = 0 }: Properties): JSX.Element => { +const GalleryGuestBanner = ({ initialized, connecting, onClick }: Properties): JSX.Element => { const { t } = useTranslation(); const { isMdAndAbove } = useBreakpoint(); @@ -31,7 +30,6 @@ const GalleryGuestBanner = ({ initialized, connecting, onClick, nftsCount = 0 }:
{ onClick={guestBannerClickHandler} initialized={initialized} connecting={connecting} - nftsCount={stats.nfts} /> {galleries === undefined ? ( diff --git a/resources/js/Pages/Galleries/MyGalleries/Components/CreateGalleryButton.tsx b/resources/js/Pages/Galleries/MyGalleries/Components/CreateGalleryButton.tsx index 921d56f4c..49a10c350 100644 --- a/resources/js/Pages/Galleries/MyGalleries/Components/CreateGalleryButton.tsx +++ b/resources/js/Pages/Galleries/MyGalleries/Components/CreateGalleryButton.tsx @@ -13,7 +13,7 @@ export const CreateGalleryButton = ({ isDisabled, onClick, }: { - nftCount: number; + nftCount?: number; variant?: ButtonVariant; className?: string; isDisabled?: boolean; @@ -23,7 +23,7 @@ export const CreateGalleryButton = ({ const createGalleryUrl = route("my-galleries.create"); - if (nftCount === 0) { + if (nftCount !== undefined && nftCount === 0) { return (