Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Unenum

Manav Rathic5c2a1bbf46d
diff --git a/web/apps/photos/src/components/Collections/CollectionListBar/ScrollButton.tsx b/web/apps/photos/src/components/Collections/CollectionListBar/ScrollButton.tsx
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/web/apps/photos/src/components/Collections/CollectionListBar/index.tsx b/web/apps/photos/src/components/Collections/CollectionListBar/index.tsx
index 2dba72ab33..6bca9dbb13 100644
--- a/web/apps/photos/src/components/Collections/CollectionListBar/index.tsx
+++ b/web/apps/photos/src/components/Collections/CollectionListBar/index.tsx
@@ -153,9 +153,7 @@ const CollectionListBar = (props: IProps) => {
<Box display="flex" alignItems="flex-start" gap={2}>
<CollectionListWrapper>
{!onFarLeft && (
- <ScrollButtonLeft
- onClick={scrollComponent(SCROLL_DIRECTION.LEFT)}
- />
+ <ScrollButtonLeft onClick={scrollComponent(-1)} />
)}
<AutoSizer disableHeight>
{({ width }) => (
@@ -176,9 +174,7 @@ const CollectionListBar = (props: IProps) => {
)}
</AutoSizer>
{!onFarRight && (
- <ScrollButtonRight
- onClick={scrollComponent(SCROLL_DIRECTION.RIGHT)}
- />
+ <ScrollButtonRight onClick={scrollComponent(+1)} />
)}
</CollectionListWrapper>
{!isMobile && (
@@ -204,11 +200,6 @@ const CollectionListBar = (props: IProps) => {
export default CollectionListBar;
-enum SCROLL_DIRECTION {
- LEFT = -1,
- RIGHT = +1,
-}
-
function useComponentScroll({ dependencies }: { dependencies: any[] }) {
const componentRef = useRef<HTMLDivElement>(null);
@@ -247,7 +238,7 @@ function useComponentScroll({ dependencies }: { dependencies: any[] }) {
updateScrollObj();
}, [...dependencies]);
- const scrollComponent = (direction: SCROLL_DIRECTION) => () => {
+ const scrollComponent = (direction: number) => () => {
componentRef.current.scrollBy(250 * direction, 0);
};
diff --git a/web/packages/shared/hooks/useComponentScroll.tsx b/web/packages/shared/hooks/useComponentScroll.tsx
deleted file mode 100644
index e69de29bb2..0000000000