-
Notifications
You must be signed in to change notification settings - Fork 1
/
Draft.js
94 lines (88 loc) · 2.25 KB
/
Draft.js
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
Draft.js;
import React from "react";
import { View, Image, Text, ImageBackground, StyleSheet } from "react-native";
import styles from "./styles";
const items = [
{
id: 1,
icon: "musicnote",
title: "Media",
},
{
id: 2,
icon: "alarmclock",
title: "Software Updates",
},
{
id: 3,
icon: "thermometer",
title: "Climate",
},
];
const CarItem = (props) => {
const getMenuItems = () => {
return items.map((item) => {
let key = item.id;
let icon = item.icon;
let title = item.title;
return (
<View style={styles.menuRow} key={key}>
<Image
source={require("../../assets/" + { icon } + ".png")}
style={styles.icon}
/>
<Text style={styles.menuText}>{title}</Text>
<Image
source={require("../../assets/chevronright.png")}
style={styles.icon}
/>
</View>
);
});
};
return (
<View style={styles.carContainer}>
<ImageBackground
source={require("../../assets/background.jpeg")}
style={styles.backgroundImage}
/>
<View style={styles.header}>
<Image
source={require("../../assets/settings.png")}
style={styles.icon}
/>
<Text style={styles.headerTitle}>My Model 3</Text>
<Image
source={require("../../assets/treasure.png")}
style={styles.icon}
/>
</View>
<View style={styles.battery}>
<Image
source={require("../../assets/battery.png")}
style={styles.batteryIcon}
/>
<Text style={styles.batteryText}>150 mi</Text>
</View>
<View style={styles.parked}>
<Text style={styles.parkedText}>Parked</Text>
</View>
<View style={styles.threeIcons}>
<Image
source={require("../../assets/musicnote.png")}
style={styles.icon}
/>
<Image
source={require("../../assets/chevronright.png")}
style={styles.icon}
/>
<Image
source={require("../../assets/chevronright.png")}
style={styles.icon}
/>
</View>
<View style={styles.menuItems}>{getMenuItems()}</View>
</View>
);
};
export default CarItem;