-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f05aa51
commit e33bc9b
Showing
12 changed files
with
158 additions
and
43 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React, {Component} from 'react'; | ||
import {Router, Scene} from 'react-native-router-flux'; | ||
import MainPage from '../app/pages/MainPage' | ||
import {AsyncStorage,Text,View} from 'react-native' | ||
|
||
class App extends Component { | ||
|
||
render() { | ||
|
||
|
||
return ( | ||
<Router> | ||
<Scene key="root"> | ||
<Scene key="testPage" component={MainPage} title={"Title- Test- Page"}/> | ||
</Scene> | ||
</Router> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { Component } from 'react'; | ||
import { Text, View, TouchableOpacity, StyleSheet, Image } from 'react-native'; | ||
|
||
class MainPage extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {} | ||
} | ||
|
||
render() { | ||
return ( | ||
<View> | ||
<Text>Test </Text> | ||
|
||
</View> | ||
); | ||
} | ||
} | ||
|
||
export default MainPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
var colors={ | ||
|
||
}; | ||
module.exports = colors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const images= { | ||
|
||
} | ||
module.export = images; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const strings = { | ||
"GENARAL_TEXTS":{ | ||
"TITLE":"React-Native-Stack", | ||
}, | ||
}; | ||
|
||
module.exports = strings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import axios from 'axios' | ||
import PubSub from './PubSub' | ||
|
||
import {SERVER_URL} from '../services/config' | ||
|
||
var token = ""; | ||
|
||
function createAxios() { | ||
return axios.create({ | ||
baseURL: SERVER_URL, | ||
headers: { | ||
"token": null | ||
// 'Authorization':"Bearer "+token | ||
}, | ||
|
||
validateStatus: function (status) { | ||
return true | ||
}, | ||
}) | ||
} | ||
|
||
function request(method, url, data) { | ||
PubSub.emit("ajax:started"); | ||
return createAxios()({ | ||
method: method, | ||
url: url, | ||
data: data | ||
}).then(function (r) { | ||
PubSub.emit("ajax:finished") | ||
return r | ||
}) | ||
} | ||
|
||
const Http = { | ||
post(url, data) { | ||
return request('post', url, data); | ||
}, | ||
get(url) { | ||
return request('get', url) | ||
}, | ||
put(url, data) { | ||
return request('put', url, data) | ||
}, | ||
|
||
delete(url, data) { | ||
return request('delete', url, data) | ||
}, | ||
|
||
patch(url, data) { | ||
return request('patch', url, data) | ||
}, | ||
|
||
getBaseUrl() { | ||
return SERVER_URL | ||
} | ||
} | ||
|
||
export default Http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export default { | ||
|
||
events: {}, | ||
|
||
on: function (eventName, fn) { | ||
this.events[eventName] = this.events[eventName] || [] | ||
this.events[eventName].push(fn) | ||
}, | ||
|
||
off: function(eventName, fn) { | ||
if (this.events[eventName]) { | ||
for (var i = 0; i < this.events[eventName].length; i++) { | ||
|
||
if (this.events[eventName][i] === fn) { | ||
this.events[eventName].splice(i, 1) | ||
break | ||
} | ||
} | ||
} | ||
}, | ||
|
||
emit: function (eventName, data, callback) { | ||
if (this.events[eventName]) { | ||
this.events[eventName].forEach(function(fn) { | ||
fn(data) | ||
|
||
if(callback) { | ||
callback() | ||
} | ||
|
||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
|
||
SERVER_URL: "my-api-link || localhost:8982" | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { AppRegistry } from 'react-native'; | ||
import App from './App'; | ||
import App from './app/index'; | ||
|
||
AppRegistry.registerComponent('reactnativestack', () => App); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters