diff --git a/frontend/src/components/ui/DataBar/DataBar.jsx b/frontend/src/components/ui/DataBar/DataBar.jsx
index b595971..fedb1ce 100644
--- a/frontend/src/components/ui/DataBar/DataBar.jsx
+++ b/frontend/src/components/ui/DataBar/DataBar.jsx
@@ -5,6 +5,17 @@ import {SortDropdown} from './SortDropdown';
import ToggleSelectButton from './ToggleSelectButton';
import AddButton from './AddButton';
+const FloatingBar = ({children}) => (
+ <>
+
+
+ >
+);
+
const DataBar = ({
onSearch,
searchPlaceholder = 'Search by name or tag...',
@@ -19,82 +30,67 @@ const DataBar = ({
toggleSelectionMode,
onAdd,
addButtonLabel = 'Add New',
- showAddButton = true
+ showAddButton = true,
+ className
}) => {
const [isFloating, setIsFloating] = useState(false);
- const [isVisible, setIsVisible] = useState(true);
- const [lastScrollY, setLastScrollY] = useState(0);
useEffect(() => {
const handleScroll = () => {
- const currentScrollY = window.scrollY;
-
- // Show/hide based on scroll direction
- setIsVisible(currentScrollY <= 0 || currentScrollY < lastScrollY);
-
- // Start floating once we scroll past the initial position
- setIsFloating(currentScrollY > 64); // Approximately the height of the bar
-
- setLastScrollY(currentScrollY);
+ setIsFloating(window.scrollY > 64);
};
window.addEventListener('scroll', handleScroll, {passive: true});
return () => window.removeEventListener('scroll', handleScroll);
- }, [lastScrollY]);
+ }, []);
- return (
-
-
-
+
+
+
+
setSortBy(key)}
/>
-
- setSortBy(key)}
- />
-
+
-
-
-
-
-
-
-
+
{showAddButton && !isSelectionMode && (
-
+
)}
+ >
+ );
+
+ if (isFloating) {
+ return {controls};
+ }
+
+ return (
+
);
};