mirror of
https://github.com/status-im/rn-emoji-keyboard.git
synced 2025-02-04 12:23:28 +00:00
fix: android active indicator
This commit is contained in:
parent
935fe7009f
commit
f6f9d40647
@ -33,7 +33,6 @@ export const Categories = ({ flatListRef, scrollNav }: CategoriesProps) => {
|
|||||||
|
|
||||||
const activeIndicator = React.useCallback(
|
const activeIndicator = React.useCallback(
|
||||||
() => (
|
() => (
|
||||||
// <Animated.View style={[styles.activeIndicator, { left: scrollNav }]} />
|
|
||||||
<Animated.View
|
<Animated.View
|
||||||
style={[
|
style={[
|
||||||
styles.activeIndicator,
|
styles.activeIndicator,
|
||||||
@ -58,6 +57,7 @@ export const Categories = ({ flatListRef, scrollNav }: CategoriesProps) => {
|
|||||||
horizontal={true}
|
horizontal={true}
|
||||||
onScrollToIndexFailed={(e) => console.log(e)}
|
onScrollToIndexFailed={(e) => console.log(e)}
|
||||||
ListHeaderComponent={activeIndicator}
|
ListHeaderComponent={activeIndicator}
|
||||||
|
ListHeaderComponentStyle={styles.activeIndicatorContainer}
|
||||||
extraData={ctx?.activeCategoryIndex}
|
extraData={ctx?.activeCategoryIndex}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
@ -91,4 +91,9 @@ const styles = StyleSheet.create({
|
|||||||
backgroundColor: 'white',
|
backgroundColor: 'white',
|
||||||
borderRadius: 6,
|
borderRadius: 6,
|
||||||
},
|
},
|
||||||
|
activeIndicatorContainer: {
|
||||||
|
position: 'absolute',
|
||||||
|
width: 28,
|
||||||
|
height: 28,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
@ -30,10 +30,6 @@ export const EmojiCategory = ({ item }: { item: CategoryTypes }) => {
|
|||||||
const [empty, setEmpty] = React.useState<EmojiType[]>([]);
|
const [empty, setEmpty] = React.useState<EmojiType[]>([]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
console.log(
|
|
||||||
numberOfColumns.current -
|
|
||||||
(emojisByGroup[item].length % numberOfColumns.current)
|
|
||||||
);
|
|
||||||
const fillWithEmpty = new Array(
|
const fillWithEmpty = new Array(
|
||||||
numberOfColumns.current -
|
numberOfColumns.current -
|
||||||
(emojisByGroup[item].length % numberOfColumns.current)
|
(emojisByGroup[item].length % numberOfColumns.current)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user