-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathAppbarBackIcon.tsx
More file actions
54 lines (48 loc) · 1.21 KB
/
AppbarBackIcon.tsx
File metadata and controls
54 lines (48 loc) · 1.21 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import * as React from 'react';
import { Image, Platform, StyleSheet, View } from 'react-native';
import { useTheme } from '../../core/theming';
import MaterialCommunityIcon from '../MaterialCommunityIcon';
const AppbarBackIcon = ({ size, color }: { size: number; color: string }) => {
const theme = useTheme();
const iosIconSize = size - 3;
return Platform.OS === 'ios' ? (
<View
style={[
styles.wrapper,
{
width: size,
height: size,
transform: [{ scaleX: theme.direction === 'rtl' ? -1 : 1 }],
},
]}
>
<Image
source={require('../../assets/back-chevron.png')}
style={[
styles.icon,
{ tintColor: color, width: iosIconSize, height: iosIconSize },
]}
accessibilityIgnoresInvertColors
/>
</View>
) : (
<MaterialCommunityIcon
name="arrow-left"
color={color}
size={size}
direction={theme.direction}
/>
);
};
const styles = StyleSheet.create({
wrapper: {
alignItems: 'center',
justifyContent: 'center',
},
icon: {
resizeMode: 'contain',
},
});
export default AppbarBackIcon;
// @component-docs ignore-next-line
export { AppbarBackIcon };