diff --git a/frontend/src/components/Scroll/ChevronScroll.tsx b/frontend/src/components/Scroll/ChevronScroll.tsx index 4cea5fd9..bb3cf8d5 100644 --- a/frontend/src/components/Scroll/ChevronScroll.tsx +++ b/frontend/src/components/Scroll/ChevronScroll.tsx @@ -13,9 +13,9 @@ function ChevronScroll(props: React.PropsWithChildren<{}>) { (e: React.UIEvent) => { const { scrollLeft, scrollWidth, clientWidth } = e.currentTarget; const maxScroll = scrollWidth - clientWidth - 1; - // show left chevron if not at start of scrollable area + // Show left chevron if not at the start of the scrollable area setShowLeftChevron(scrollLeft !== 0); - //show right chevron if not at end of scrollable area + // Show right chevron if not at the end of the scrollable area setShowRightChevron(scrollLeft < maxScroll); }, [] @@ -32,7 +32,7 @@ function ChevronScroll(props: React.PropsWithChildren<{}>) { }); setChildIndex(childIndex + 1); } else if (direction === "left") { - // if at end of scrollable area, don't want to skip over partially cut element + // If at the end of the scrollable area, don't skip over a partially cut element if (!showRightChevron) { scrollRef.current.scrollBy({ left: -1, @@ -50,13 +50,10 @@ function ChevronScroll(props: React.PropsWithChildren<{}>) { }; return ( -
+
- +
); } diff --git a/frontend/src/tw-components/ChevronScrollTailwind.tsx b/frontend/src/tw-components/ChevronScrollTailwind.tsx new file mode 100644 index 00000000..54b1718b --- /dev/null +++ b/frontend/src/tw-components/ChevronScrollTailwind.tsx @@ -0,0 +1,35 @@ +import React from "react"; + +const ChevronScroll = () => { + return ( +
+
+ {/* Chevron Scroll Left Button */} + + + {/* Scrollable Content */} +
Scrollable content goes here
+ + {/* Chevron Scroll Right Button */} + +
+ + {/* Clear Button */} + +
+ ); +}; + +export default ChevronScroll;