-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreens.js
111 lines (103 loc) · 3.47 KB
/
screens.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import {Navigation} from 'react-native-navigation';
import {Button, SafeAreaView, Text, View} from 'react-native';
import ReactNativeBlobUtil from 'react-native-blob-util';
import React from "react";
function Tab1() {
ReactNativeBlobUtil.fetch('POST', 'https://content.dropboxapi.com/2/files/upload', {
Authorization: "Bearer access token",
"Dropbox-API-Arg":"{\"autorename\":false,\"mode\":\"add\",\"mute\":false,\"path\":\"/Test/testfile.png\",\"strict_conflict\":false}",
"Content-Type": "application/octet-stream",
"data-binary": "@local_file.png"
}, ReactNativeBlobUtil.wrap('./testfile.png')).then((res) => console.log(res, res.info().status));
return (
<View>
<Text>{'Ich bin Tab 1'}</Text>
</View>
)
}
function Tab2() {
return (
<View>
<Text>{'Ich bin Tab 2'}</Text>
</View>
)
}
function Mainscreen() {
return (
<SafeAreaView style={{backgroundColor: '#fff'}}>
<Button
onPress={loadRNN}
title={'clickme'}
color={'#000'}
/>
</SafeAreaView>
);
}
function loadRNN() {
Navigation.setRoot({
root: {
bottomTabs: {
options: {
statusBar: {
style: 'dark',
backgroundColor: '#ff0066'
},
topBar: {
visible: true,
leftButtons: [
{id: 'menu', text: 'A', color: '#fff'}
],
rightButtons: []
}
},
children: [{
stack: {
children: [{
component: {
name: 'pages.tab1',
id: 'Vacation'
}
}],
options: {
bottomTab: {
text: 'Tab 1'
},
topBar: {
title: {
text: 'Tab 1',
color: '#fff'
}
}
}
}
},
{
stack: {
children: [{
component: {
name: 'pages.tab2',
id: 'Vacation'
}
}],
options: {
bottomTab: {
text: 'Tab 2'
},
topBar: {
title: {
text: 'Tab 2',
color: '#fff'
}
}
}
}
}]
}
}
});
}
export function registerScreens() {
Navigation.registerComponent('pages.tab1', () => Tab1);
Navigation.registerComponent('pages.tab2', () => Tab2);
Navigation.registerComponent('main', () => Mainscreen);
}