Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: minor refactor #473

Merged
merged 3 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ module.exports = {
extends: ['@react-native-community', 'prettier'],
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
'prettier/prettier': [
'error',
{
printWidth: 80,
arrowParens: 'avoid',
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
useTabs: false,
},
],
'prettier/prettier': 'error',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ function BottomSheetHandleContainerComponent({

return refs;
}, [_providedSimultaneousHandlers, _internalSimultaneousHandlers]);

const shouldRenderHandle = useMemo(
() => _providedHandleComponent !== null,
[_providedHandleComponent]
);
//#endregion

//#region callbacks
Expand Down Expand Up @@ -96,6 +91,7 @@ function BottomSheetHandleContainerComponent({
);
}, [animatedIndex, animatedPosition, _providedHandleComponent]);

const shouldRenderHandle = _providedHandleComponent !== null;
return shouldRenderHandle ? (
<PanGestureHandler
enabled={enableHandlePanningGesture}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function createBottomSheetScrollableComponent<T, P>(
ref={scrollableRef}
overScrollMode={overScrollMode}
scrollEventThrottle={16}
onScrollBeginDrag={handleScrollEvent}
onScroll={handleScrollEvent}
animatedProps={scrollableAnimatedProps}
style={containerStyle}
/>
Expand Down
1 change: 0 additions & 1 deletion src/hooks/useScrollableInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export const useScrollableInternal = () => {
: 0;
// @ts-ignore
scrollTo(scrollableRef, 0, lockPosition, false);
scrollableContentOffsetY.value = lockPosition;
scrollableContentOffsetY.value = 0;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/normalizeSnapPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export const normalizeSnapPoint = (
normalizedSnapPoint =
(Number(normalizedSnapPoint.split('%')[0]) * containerHeight) / 100;
}
return Math.max(0, containerHeight - normalizedSnapPoint);
return Math.round(Math.max(0, containerHeight - normalizedSnapPoint));
gorhom marked this conversation as resolved.
Show resolved Hide resolved
};