Skip to content

Commit

Permalink
Merge pull request #1825 from blockscout/fix-marketplace-banner
Browse files Browse the repository at this point in the history
Fix marketplace banner
  • Loading branch information
maxaleks authored Apr 16, 2024
2 parents ba3b101 + 3a883b5 commit a4156eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ui/marketplace/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import IframeBanner from './Banner/IframeBanner';
const feature = config.features.marketplace;

type BannerProps = {
apps: Array<MarketplaceAppPreview>;
apps: Array<MarketplaceAppPreview> | undefined;
favoriteApps: Array<string>;
isLoading: boolean;
onInfoClick: (id: string) => void;
onFavoriteClick: (id: string, isFavorite: boolean, source: 'Banner') => void;
onAppClick: (event: MouseEvent, id: string) => void;
}

const Banner = ({ apps, favoriteApps, isLoading, onInfoClick, onFavoriteClick, onAppClick }: BannerProps) => {
const Banner = ({ apps = [], favoriteApps, isLoading, onInfoClick, onFavoriteClick, onAppClick }: BannerProps) => {
if (!feature.isEnabled) {
return null;
}
Expand Down
3 changes: 2 additions & 1 deletion ui/marketplace/useMarketplace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default function useMarketplace() {
isError,
error,
categories,
apps: data,
displayedApps,
showAppInfo,
selectedAppId,
Expand All @@ -167,6 +168,7 @@ export default function useMarketplace() {
categories,
clearSelectedAppId,
selectedAppId,
data,
displayedApps,
error,
favoriteApps,
Expand All @@ -179,7 +181,6 @@ export default function useMarketplace() {
isAppInfoModalOpen,
isDisclaimerModalOpen,
showDisclaimer,
data?.length,
isCategoriesPlaceholderData,
showContractList,
contractListModalType,
Expand Down
3 changes: 2 additions & 1 deletion ui/pages/Marketplace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const Marketplace = () => {
filterQuery,
onSearchInputChange,
showAppInfo,
apps,
displayedApps,
selectedAppId,
clearSelectedAppId,
Expand Down Expand Up @@ -170,7 +171,7 @@ const Marketplace = () => {
/>

<Banner
apps={ displayedApps }
apps={ apps }
favoriteApps={ favoriteApps }
isLoading={ isPlaceholderData }
onInfoClick={ showAppInfo }
Expand Down

0 comments on commit a4156eb

Please sign in to comment.