-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNewTab.js
58 lines (54 loc) · 1.33 KB
/
NewTab.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
import AsyncStorage from "@react-native-async-storage/async-storage";
import React from "react";
import { Pressable, StyleSheet, Text } from "react-native";
const colors = require("./colors.json");
export default function NewTab(props) {
return (
<Pressable
style={{
...styles.tabButton,
backgroundColor: "rgba(0, 0, 0, 0)",
}}
onPress={() => {
AsyncStorage.getItem("tabs").then((data) => {
let tabs = JSON.parse(data);
let newTab = { name: "", reference: "0,1,1" };
tabs.push(newTab);
AsyncStorage.setItem("tabs", JSON.stringify(tabs)).then(() => {
props.updateLocalTabs();
props.setCurrentTab(props.index);
});
});
}}
>
<Text
style={{
...styles.tabText,
color: colors.tab.text.inactive[props.theme],
}}
>
+
</Text>
</Pressable>
);
}
const styles = StyleSheet.create({
tabButton: {
alignItems: "center",
justifyContent: "center",
// paddingVertical: 10,
paddingTop: 14,
paddingBottom: 6,
paddingHorizontal: 15,
// elevation: 3,
borderTopLeftRadius: 12,
borderTopRightRadius: 12,
},
tabText: {
fontSize: 20,
lineHeight: 21,
fontWeight: "bold",
letterSpacing: 0.25,
// color: "white",
},
});