-
-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathUsageCustomRipple.tsx
30 lines (27 loc) · 902 Bytes
/
UsageCustomRipple.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React from 'react';
import { Ionicons } from '@expo/vector-icons';
import { View } from 'react-native';
import { HeaderButtons, HeaderButton, Item } from 'react-navigation-header-buttons';
import Touchable from 'react-native-platform-touchable';
const CustomRipple = (props) => (
<HeaderButton
{...props}
background={Touchable.Ripple('red', true)}
IconComponent={Ionicons}
iconSize={23}
color="blue"
/>
);
export function UsageCustomRipple({ navigation }) {
React.useLayoutEffect(() => {
navigation.setOptions({
headerRight: () => (
<HeaderButtons HeaderButtonComponent={CustomRipple}>
<Item title="search" iconName="ios-search" onPress={() => alert('search')} />
<Item title="select" onPress={() => alert('select')} />
</HeaderButtons>
),
});
}, [navigation]);
return <View style={{ flex: 1 }}></View>;
}