Newer
Older
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
55
56
57
58
59
60
61
62
63
64
65
import React from 'react';
import { View, TouchableOpacity, Text, StyleSheet } from 'react-native';
import { BottomTabBar } from '@react-navigation/bottom-tabs';
import ScanQrSvg from 'src/assets/svg/scan-qr.svg';
import {TextTheme} from "../theme/theme";
import {useNavigation} from "@react-navigation/core";
import {Screens} from "../type/navigators";
function TabStackCustom(props: any) {
const navigation = useNavigation()
return (
<View style={styles.container}>
<BottomTabBar {...props} />
<TouchableOpacity
style={styles.floatingButton}
onPress={() => {
navigation.navigate(Screens.Scan);
}}
>
<ScanQrSvg
style={[
styles.svg
]}
resizeMode="contain"
/>
</TouchableOpacity>
</View>
);
}
const styles = StyleSheet.create({
container: {
position: 'relative',
},
floatingButton: {
position: 'absolute',
bottom: 100,
right: 10,
width: 56,
height: 56,
borderRadius: 28, // half of width/height to get a round shape
overflow: 'hidden', // this will ensure the gradient doesn't overflow the button
backgroundColor: '#42d0e2',
elevation: 4, // Shadow for Android
shadowOffset: { width: 0, height: 2 }, // Shadow for iOS
shadowOpacity: 0.3,
shadowRadius: 2, // Shadow for iOS
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
text: {
...TextTheme.label,
},
buttonContainer: {
},
svg: {
width: 34,
height: 34,
}
});
export default TabStackCustom;