Passed
Push — dev ( 960b6d...f9a638 )
by Kasper
01:04 queued 12s
created

components/drawer/NavBar.tsx   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 93
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 71
mnd 0
bc 0
fnc 4
dl 0
loc 93
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
B NavBar.tsx ➔ NavBar 0 47 4
1
import React from "react";
2
import { ScrollView, Image, Text, View, StyleSheet, StatusBar, Button, Pressable } from 'react-native';
3
import Icon from 'react-native-vector-icons/Octicons';
4
5
6
7
export default function NavBar({navigation}) {
8
    function DrawerButton({navigation}) {
9
        return (
10
          <Pressable style={[styles.drawer, styles.shadowProp]} onPress={() => navigation.openDrawer()}> 
11
            <Icon 
12
            name='three-bars' 
13
            size={20} 
14
            color='black'
15
            />
16
          </Pressable>
17
        );
18
      };
19
20
      function HowToDrive({navigation}) {
21
        return (
22
            <Pressable style={[styles.info, styles.shadowProp]}>
23
                <Icon 
24
                    name='question' 
25
                    size={16} 
26
                    color='black'
27
                />
28
                <Text style={{marginLeft: 8}}>How to drive?</Text>
29
            </Pressable>
30
        )
31
      }
32
33
      function Drive({navigation}) {
34
        return (
35
            <Pressable style={[styles.drawer, styles.shadowProp]}> 
36
              <Icon 
37
              name='paper-airplane' 
38
              size={20} 
39
              color='black'
40
              />
41
            </Pressable>
42
          );
43
      }
44
45
    return (
46
        <View style={styles.container}>
47
            <DrawerButton navigation={navigation}/>
48
            <HowToDrive navigation={navigation}/>
49
            <Drive navigation={navigation}/>
50
        </View>
51
    )
52
}
53
54
const styles = StyleSheet.create({
55
    container: {
56
        // flex: 1,
57
        position: 'absolute',
58
        // backgroundColor: 'red',
59
        // height: 60,
60
        justifyContent: 'space-evenly',
61
        width: '100%',
62
        flexDirection: 'row',
63
    },
64
    info: {
65
        // position: 'absolute',
66
        width: 250,
67
        height: 40, 
68
        // left: 50,
69
        backgroundColor: 'white',
70
        marginTop: 50,
71
        borderRadius: 25,
72
        justifyContent: 'center',
73
        alignItems: 'center',
74
        flexDirection: 'row'
75
    },
76
77
    drawer: {
78
        // position: 'absolute',
79
        width: 40,
80
        height: 40, 
81
        // left: 50,
82
        backgroundColor: 'white',
83
        marginTop: 50,
84
        borderRadius: 25,
85
        justifyContent: 'center',
86
        alignItems: 'center',
87
    },
88
    
89
    shadowProp: {
90
        elevation: 5,
91
        shadowColor: 'black'
92
      },
93
});