Add new hero carousel and start working on cards #153

This commit is contained in:
Prayag Prajapati committed 2023-08-24 17:25:07 +05:30
1 parent 7f8ec6fc98
commit e11056c2ce
13 files changed
+355 -916

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
/** @format */
import { useEffect, useMemo, useState } from "react";
const useIntersecting = (ref) => {
const [isIntersecting, setIntersecting] = useState(false);
const observer = useMemo(
() =>
new IntersectionObserver(([entry]) =>
setIntersecting(entry.isIntersecting),
),
[ref],
);
useEffect(() => {
observer.observe(ref.current);
return () => observer.disconnect();
}, []);
return isIntersecting;
};
export default useIntersecting;
+8
View File
@@ -0,0 +1,8 @@
/** @format */
import { create } from "zustand";
export const useCarouselStore = create((set) => ({
direction: "right",
setDirection: (dir) => set(() => ({ direction: dir })),
}));