diff --git a/web/app/components/explore/banner/banner.tsx b/web/app/components/explore/banner/banner.tsx index 1e5bcffb94..a05c0e34a2 100644 --- a/web/app/components/explore/banner/banner.tsx +++ b/web/app/components/explore/banner/banner.tsx @@ -1,5 +1,6 @@ import type { FC } from 'react' import type { Banner as BannerType } from '@/models/app' +import { cn } from '@langgenius/dify-ui/cn' import * as React from 'react' import { useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -80,6 +81,7 @@ const Banner: FC = () => { ) const isPaused = isHovered || isResizing + const notShowSlider = isError || enabledBanners.length === 0 // Handle window resize to pause animation useEffect(() => { @@ -106,16 +108,13 @@ const Banner: FC = () => { if (isLoading) return - if (isError || enabledBanners.length === 0) - return null - return (
setIsHovered(true)} onMouseLeave={() => setIsHovered(false)} > -
+

{t('banner.greeting', { name: userName, ns: 'explore' })}

@@ -124,39 +123,42 @@ const Banner: FC = () => {

- - - - {enabledBanners.map((banner, index) => ( - - - - ))} - - + {!notShowSlider + && ( + + + + {enabledBanners.map((banner, index) => ( + + + + ))} + + + )}
) }