diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-07 13:14:36 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-04-07 13:14:36 -0400 |
commit | f36ce8993d45ed69845a2ff6340f4d52d03855d9 (patch) | |
tree | 2c2acec3adfeda204c0b48eb7c7b22a7802780eb /src/components/taggs | |
parent | 4b0e55cd751bd77e05b8158177a74bd190974218 (diff) | |
parent | a3abb3abe322ea84306e1a12cec46972a81a37de (diff) |
Merge branch 'master' into chat-poc
# Conflicts:
# src/components/profile/Content.tsx
# src/components/taggs/TaggsBar.tsx
# src/screens/profile/ProfileScreen.tsx
# src/types/types.ts
Diffstat (limited to 'src/components/taggs')
-rw-r--r-- | src/components/taggs/TaggsBar.tsx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/components/taggs/TaggsBar.tsx b/src/components/taggs/TaggsBar.tsx index 87dabc3d..a5003fbb 100644 --- a/src/components/taggs/TaggsBar.tsx +++ b/src/components/taggs/TaggsBar.tsx @@ -1,16 +1,17 @@ import React, {useEffect, useState} from 'react'; -import {StyleSheet} from 'react-native'; +import {LayoutChangeEvent, StyleSheet} from 'react-native'; import Animated, { - useDerivedValue, - interpolate, Extrapolate, + interpolate, useAnimatedStyle, + useDerivedValue, } from 'react-native-reanimated'; +import {useSafeAreaInsets} from 'react-native-safe-area-context'; import {useDispatch, useSelector, useStore} from 'react-redux'; import { INTEGRATED_SOCIAL_LIST, - SOCIAL_LIST, PROFILE_CUTOUT_BOTTOM_Y, + SOCIAL_LIST, } from '../../constants'; import {getLinkedSocials} from '../../services'; import {loadIndividualSocial, updateSocial} from '../../store/actions'; @@ -18,7 +19,6 @@ import {RootState} from '../../store/rootReducer'; import {ScreenType} from '../../types'; import {canViewProfile} from '../../utils'; import Tagg from './Tagg'; -import {useSafeAreaInsets} from 'react-native-safe-area-context'; const {View, ScrollView} = Animated; interface TaggsBarProps { @@ -27,6 +27,7 @@ interface TaggsBarProps { userXId: string | undefined; screenType: ScreenType; linkedSocials?: string[]; + onLayout: (event: LayoutChangeEvent) => void; } const TaggsBar: React.FC<TaggsBarProps> = ({ y, @@ -34,6 +35,7 @@ const TaggsBar: React.FC<TaggsBarProps> = ({ userXId, screenType, linkedSocials, + onLayout, }) => { let [taggs, setTaggs] = useState<Object[]>([]); let [taggsNeedUpdate, setTaggsNeedUpdate] = useState(true); @@ -140,7 +142,7 @@ const TaggsBar: React.FC<TaggsBarProps> = ({ })); return taggs.length > 0 ? ( - <View style={[styles.container, animatedStyles]}> + <View style={[styles.container, animatedStyles]} onLayout={onLayout}> <ScrollView horizontal showsHorizontalScrollIndicator={false} |