aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/screens/profile/IndividualMoment.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/screens/profile/IndividualMoment.tsx b/src/screens/profile/IndividualMoment.tsx
index b14b31fa..80438bcd 100644
--- a/src/screens/profile/IndividualMoment.tsx
+++ b/src/screens/profile/IndividualMoment.tsx
@@ -9,7 +9,7 @@ import {AVATAR_DIM} from '../../constants';
import {MainStackParams} from '../../routes';
import {RootState} from '../../store/rootreducer';
import {MomentPostType} from '../../types';
-import {normalize, StatusBarHeight} from '../../utils';
+import {isIPhoneX, normalize, StatusBarHeight} from '../../utils';
/**
* Individual moment view opened when user clicks on a moment tile
@@ -65,9 +65,11 @@ const IndividualMoment: React.FC<IndividualMomentProps> = ({
}, []);
const scrollTo = (index: number) => {
+ // TODO: make this dynamic
+ const offset = isIPhoneX() ? -(AVATAR_DIM + 100) : -(AVATAR_DIM + 160);
scrollRef.current?.scrollToIndex({
index: index,
- viewOffset: -(AVATAR_DIM + normalize(90)),
+ viewOffset: offset,
});
};