Skip to content

Commit

Permalink
fix interpolation range to account for safe insets (#5130)
Browse files Browse the repository at this point in the history
  • Loading branch information
walmat authored and ibrahimtaveras00 committed Oct 18, 2023
1 parent 3e65720 commit 0b0bf61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/coin-divider/CoinDivider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import CoinDividerAssetsValue from './CoinDividerAssetsValue';
import CoinDividerEditButton from './CoinDividerEditButton';
import CoinDividerOpenButton from './CoinDividerOpenButton';
import EditAction from '@/helpers/EditAction';
import { navbarHeight } from '@/components/navbar/Navbar';
import {
useAccountSettings,
useCoinListEditOptions,
Expand All @@ -25,6 +26,7 @@ import {
import { emitChartsRequest } from '@/redux/explorer';
import styled from '@/styled-thing';
import { padding } from '@/styles';
import { useSafeAreaInsets } from 'react-native-safe-area-context';

export const CoinDividerHeight = 30;
export const CoinDividerContainerHeight = CoinDividerHeight + 11;
Expand Down Expand Up @@ -61,6 +63,7 @@ const EditButtonWrapper = styled(Row).attrs({
const useInterpolationRange = isCoinListEdited => {
const position = useRecyclerAssetListPosition();
const ref = useRef();
const { top: safeAreaInsetTop } = useSafeAreaInsets();

const { scrollViewRef } = useContext(StickyHeaderContext) || {};
const [range, setRanges] = useState([0, 0]);
Expand All @@ -72,7 +75,7 @@ const useInterpolationRange = isCoinListEdited => {
ref.current?.measureLayout?.(
nativeScrollRef,
(_left, top) => {
setRanges([top - (ios ? 100 : 50), top]);
setRanges([top - (navbarHeight + safeAreaInsetTop), top]);
},
() => {}
);
Expand Down

0 comments on commit 0b0bf61

Please sign in to comment.