Skip to content

Commit

Permalink
fix: CI checks
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Feb 22, 2024
1 parent 20f51ca commit 44efead
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/components/Attachments/AttachmentCarousel/Pager/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ type AttachmentCarouselPagerProps = {
* @param showArrows If set, it will show/hide the arrows. If not set, it will toggle the arrows.
*/
onRequestToggleArrows: (showArrows?: boolean) => void;

/** A callback that is called when swipe-down-to-close gesture happens */
onClose: () => void;
};

function AttachmentCarouselPager({items, activeSource, initialPage, onPageSelected, onRequestToggleArrows, onClose}: AttachmentCarouselPagerProps, ref: ForwardedRef<AttachmentCarouselPagerHandle>) {
function AttachmentCarouselPager(
{items, activeSource, initialPage, onPageSelected, onRequestToggleArrows, onClose}: AttachmentCarouselPagerProps,
ref: ForwardedRef<AttachmentCarouselPagerHandle>,
) {
const styles = useThemeStyles();
const pagerRef = useRef<PagerView>(null);

Expand Down
2 changes: 1 addition & 1 deletion src/components/MultiGestureCanvas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import useStyleUtils from '@hooks/useStyleUtils';
import useThemeStyles from '@hooks/useThemeStyles';
import type ChildrenProps from '@src/types/utils/ChildrenProps';
import {DEFAULT_ZOOM_RANGE, SPRING_CONFIG, ZOOM_RANGE_BOUNCE_FACTORS} from './constants';
import type {CanvasSize, ContentSize, OnScaleChangedCallback, OnTapCallback, ZoomRange, OnSwipeDownCallback} from './types';
import type {CanvasSize, ContentSize, OnScaleChangedCallback, OnSwipeDownCallback, OnTapCallback, ZoomRange} from './types';
import usePanGesture from './usePanGesture';
import usePinchGesture from './usePinchGesture';
import useTapGestures from './useTapGestures';
Expand Down
2 changes: 1 addition & 1 deletion src/components/MultiGestureCanvas/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type MultiGestureCanvasVariables = {
reset: (animated: boolean, callback: () => void) => void;
onTap: OnTapCallback | undefined;
onScaleChanged: OnScaleChangedCallback | undefined;
onSwipeDown: OnSwipeDownCallback;
onSwipeDown: OnSwipeDownCallback | undefined;
};

export type {CanvasSize, ContentSize, ZoomRange, OnScaleChangedCallback, OnTapCallback, MultiGestureCanvasVariables, OnSwipeDownCallback};
4 changes: 3 additions & 1 deletion src/components/MultiGestureCanvas/usePanGesture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ const usePanGesture = ({
isSwipingDownToClose.value = false;
});

runOnJS(onSwipeDown)();
if (onSwipeDown) {
runOnJS(onSwipeDown)();
}
} else {
// Animated back to the boundary
offsetY.value = withSpring(clampedOffset.y, SPRING_CONFIG, () => {
Expand Down

0 comments on commit 44efead

Please sign in to comment.