Skip to content

Commit

Permalink
fix: do not disable create gallery button on gallery overview page (#470
Browse files Browse the repository at this point in the history
)
  • Loading branch information
patricio0312rev authored Nov 17, 2023
1 parent 92d014c commit 944a901
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import { CreateGalleryButton } from "@/Pages/Galleries/MyGalleries/Components/Cr

interface Properties extends Pick<MetaMaskState, "connecting" | "initialized"> {
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();

Expand All @@ -31,7 +30,6 @@ const GalleryGuestBanner = ({ initialized, connecting, onClick, nftsCount = 0 }:
<div className="flex h-fit justify-center">
<CreateGalleryButton
onClick={onClick}
nftCount={nftsCount}
variant={isMdAndAbove ? "secondary" : "primary"}
isDisabled={connecting || !initialized}
className="md:button-light"
Expand Down
1 change: 0 additions & 1 deletion resources/js/Pages/Galleries/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ const GalleriesIndex = ({ stats, title }: Properties): JSX.Element => {
onClick={guestBannerClickHandler}
initialized={initialized}
connecting={connecting}
nftsCount={stats.nfts}
/>

{galleries === undefined ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const CreateGalleryButton = ({
isDisabled,
onClick,
}: {
nftCount: number;
nftCount?: number;
variant?: ButtonVariant;
className?: string;
isDisabled?: boolean;
Expand All @@ -23,7 +23,7 @@ export const CreateGalleryButton = ({

const createGalleryUrl = route("my-galleries.create");

if (nftCount === 0) {
if (nftCount !== undefined && nftCount === 0) {
return (
<Tooltip
content={t("pages.galleries.my_galleries.new_gallery_no_nfts")}
Expand Down

0 comments on commit 944a901

Please sign in to comment.