summaryrefslogtreecommitdiff
path: root/src/core/components/elements/Navbar/TopBanner.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/components/elements/Navbar/TopBanner.jsx')
-rw-r--r--src/core/components/elements/Navbar/TopBanner.jsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/components/elements/Navbar/TopBanner.jsx b/src/core/components/elements/Navbar/TopBanner.jsx
index df47e87d..f438ae67 100644
--- a/src/core/components/elements/Navbar/TopBanner.jsx
+++ b/src/core/components/elements/Navbar/TopBanner.jsx
@@ -4,8 +4,9 @@ import odooApi from '@/core/api/odooApi';
import SmoothRender from '~/components/ui/smooth-render';
import Link from '../Link/Link';
import { background } from '@chakra-ui/react';
+import { useEffect } from 'react';
-const TopBanner = () => {
+const TopBanner = ({ onLoad = () => {} }) => {
const { isDesktop, isMobile } = useDevice()
const topBanner = useQuery({
queryKey: 'topBanner',
@@ -17,6 +18,12 @@ const TopBanner = () => {
const hasData = topBanner.data?.length > 0;
const data = topBanner.data?.[0] || null;
+ useEffect(() => {
+ if (hasData) {
+ onLoad();
+ }
+ }, [hasData, onLoad]);
+
return (
<SmoothRender
isLoaded={hasData}