Passed
Pull Request — dev (#7)
by Oscar
03:03
created

components/drawer/NavBar.tsx   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 87
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A NavBar.tsx ➔ NavBar 0 42 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={30} 
14
            color='black'
15
            />
16
          </Pressable>
17
        );
18
      };
19
20
      function HowToDrive({navigation}) {
21
        return (
22
            <Pressable style={[styles.info, styles.shadowProp]}>
23
                <Text>How to drive?</Text>
24
            </Pressable>
25
        )
26
      }
27
28
      function Drive({navigation}) {
29
        return (
30
            <Pressable style={[styles.drawer, styles.shadowProp]}> 
31
              <Icon 
32
              name='paper-airplane' 
33
              size={30} 
34
              color='black'
35
              />
36
            </Pressable>
37
          );
38
      }
39
40
    return (
41
        <View style={styles.container}>
42
            <DrawerButton navigation={navigation}/>
43
            <HowToDrive navigation={navigation}/>
44
            <Drive navigation={navigation}/>
45
        </View>
46
    )
47
}
48
49
const styles = StyleSheet.create({
50
    container: {
51
        // flex: 1,
52
        position: 'absolute',
53
        // backgroundColor: 'red',
54
        // height: 60,
55
        justifyContent: 'space-evenly',
56
        width: '100%',
57
        flexDirection: 'row',
58
    },
59
    info: {
60
        // position: 'absolute',
61
        width: 250,
62
        height: 50, 
63
        // left: 50,
64
        backgroundColor: 'white',
65
        marginTop: 50,
66
        borderRadius: 25,
67
        justifyContent: 'center',
68
        alignItems: 'center'
69
    },
70
71
    drawer: {
72
        // position: 'absolute',
73
        width: 50,
74
        height: 50, 
75
        // left: 50,
76
        backgroundColor: 'white',
77
        marginTop: 50,
78
        borderRadius: 25,
79
        justifyContent: 'center',
80
        alignItems: 'center',
81
    },
82
    
83
    shadowProp: {
84
        elevation: 5,
85
        shadowColor: 'black'
86
      },
87
});