Skip to content

Commit 84f049a

Browse files
committed
initial commit
0 parents  commit 84f049a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+19687
-0
lines changed

.babelrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"presets": ["babel-preset-expo"],
3+
"env": {
4+
"development": {
5+
"plugins": ["transform-react-jsx-source", "transform-decorators-legacy"]
6+
}
7+
}
8+
}

.flowconfig

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
5+
; Ignore templates for 'react-native init'
6+
<PROJECT_ROOT>/node_modules/react-native/local-cli/templates/.*
7+
8+
; Ignore RN jest
9+
<PROJECT_ROOT>/node_modules/react-native/jest/.*
10+
11+
; Ignore RNTester
12+
<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
13+
14+
; Ignore the website subdir
15+
<PROJECT_ROOT>/node_modules/react-native/website/.*
16+
17+
; Ignore the Dangerfile
18+
<PROJECT_ROOT>/node_modules/react-native/danger/dangerfile.js
19+
20+
; Ignore Fbemitter
21+
<PROJECT_ROOT>/node_modules/fbemitter/.*
22+
23+
; Ignore "BUCK" generated dirs
24+
<PROJECT_ROOT>/node_modules/react-native/\.buckd/
25+
26+
; Ignore unexpected extra "@providesModule"
27+
.*/node_modules/.*/node_modules/fbjs/.*
28+
29+
; Ignore polyfills
30+
<PROJECT_ROOT>/node_modules/react-native/Libraries/polyfills/.*
31+
32+
; Ignore various node_modules
33+
<PROJECT_ROOT>/node_modules/react-native-gesture-handler/.*
34+
<PROJECT_ROOT>/node_modules/expo/.*
35+
<PROJECT_ROOT>/node_modules/react-navigation/.*
36+
<PROJECT_ROOT>/node_modules/xdl/.*
37+
<PROJECT_ROOT>/node_modules/reqwest/.*
38+
<PROJECT_ROOT>/node_modules/metro-bundler/.*
39+
40+
[include]
41+
42+
[libs]
43+
node_modules/react-native/Libraries/react-native/react-native-interface.js
44+
node_modules/react-native/flow/
45+
node_modules/expo/flow/
46+
47+
[options]
48+
emoji=true
49+
50+
module.system=haste
51+
52+
module.file_ext=.js
53+
module.file_ext=.jsx
54+
module.file_ext=.json
55+
module.file_ext=.ios.js
56+
57+
munge_underscores=true
58+
59+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
60+
61+
suppress_type=$FlowIssue
62+
suppress_type=$FlowFixMe
63+
suppress_type=$FlowFixMeProps
64+
suppress_type=$FlowFixMeState
65+
suppress_type=$FixMe
66+
67+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
68+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
69+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
70+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
71+
72+
unsafe.enable_getters_and_setters=true
73+
74+
[version]
75+
^0.56.0

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# expo
2+
.expo/
3+
4+
# dependencies
5+
/node_modules
6+
7+
# misc
8+
.env.local
9+
.env.development.local
10+
.env.test.local
11+
.env.production.local
12+
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*

.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

App.js

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
import "./global";
2+
import React from "react";
3+
import {
4+
StyleSheet,
5+
View,
6+
TouchableOpacity,
7+
Button,
8+
AppState
9+
} from "react-native";
10+
import { StackNavigator } from "react-navigation";
11+
import { Ionicons } from "@expo/vector-icons";
12+
import Expo from "expo";
13+
import { reaction } from "mobx";
14+
import { observer } from "mobx-react";
15+
import { Home, Send, Deposit, Payment, Settings, New } from "./src/screens";
16+
import { Loader } from "./src/components";
17+
import store from "./src/store";
18+
19+
const Stack = StackNavigator(
20+
{
21+
Home: {
22+
screen: Home
23+
},
24+
Send: {
25+
screen: Send
26+
},
27+
Deposit: {
28+
screen: Deposit
29+
},
30+
Payment: {
31+
screen: Payment
32+
},
33+
Settings: {
34+
screen: Settings
35+
},
36+
New: {
37+
screen: New
38+
}
39+
},
40+
{
41+
navigationOptions: ({ navigation }) => ({
42+
headerStyle: {
43+
backgroundColor: "white"
44+
},
45+
headerLeft: (
46+
<TouchableOpacity
47+
activeOpacity={0.5}
48+
style={{
49+
padding: 15
50+
}}
51+
onPress={() => navigation.goBack()}
52+
>
53+
<Ionicons name="ios-close" size={40} color="#222" />
54+
</TouchableOpacity>
55+
),
56+
gesturesEnabled: false,
57+
headerTitleStyle: {
58+
fontFamily: "ClearSans",
59+
marginTop: -2
60+
}
61+
}),
62+
mode: "modal"
63+
}
64+
);
65+
66+
@observer
67+
export default class App extends React.Component {
68+
state = {
69+
authenticated: false,
70+
appState: AppState.currentState
71+
};
72+
73+
componentDidMount() {
74+
reaction(
75+
() => store.appReady,
76+
() => {
77+
if (store.touchIdEnabled) {
78+
this.authenticateWithFingerprint();
79+
} else {
80+
this.setState({ authenticated: true });
81+
}
82+
}
83+
);
84+
85+
AppState.addEventListener("change", this._handleAppStateChange);
86+
}
87+
88+
_handleAppStateChange = nextAppState => {
89+
if (!store.touchIdEnabled) return;
90+
91+
if (nextAppState === "background") {
92+
this.setState({ authenticated: false, appState: nextAppState });
93+
return;
94+
} else if (
95+
this.state.appState === "background" &&
96+
nextAppState === "active"
97+
) {
98+
this.setState({ appState: nextAppState });
99+
this.authenticateWithFingerprint();
100+
}
101+
};
102+
103+
authenticateWithFingerprint = () => {
104+
Expo.Fingerprint.authenticateAsync(
105+
"Unlock Stellar Wallet with Touch ID"
106+
).then(({ success, error }) => {
107+
if (success) {
108+
this.setState({ authenticated: true });
109+
}
110+
});
111+
};
112+
113+
render() {
114+
if (!store.appReady) return <Loader />;
115+
116+
return (
117+
<View style={styles.container}>
118+
<Stack />
119+
{store.touchIdEnabled &&
120+
!this.state.authenticated && (
121+
<View style={[StyleSheet.absoluteFill, styles.lockedContainer]}>
122+
<Button
123+
title="Unlock with Touch ID"
124+
onPress={this.authenticateWithFingerprint}
125+
/>
126+
</View>
127+
)}
128+
</View>
129+
);
130+
}
131+
}
132+
133+
const styles = StyleSheet.create({
134+
container: {
135+
flex: 1,
136+
backgroundColor: "white"
137+
},
138+
lockedContainer: {
139+
backgroundColor: "white",
140+
alignItems: "center",
141+
justifyContent: "center"
142+
}
143+
});

App.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import App from './App';
3+
4+
import renderer from 'react-test-renderer';
5+
6+
it('renders without crashing', () => {
7+
const rendered = renderer.create(<App />).toJSON();
8+
expect(rendered).toBeTruthy();
9+
});

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Stellar Wallet
2+
Lightweight app to send and receive lumens over the Stellar network.
3+
4+
## Demo
5+
You can try this app out using [Expo](https://exp.host/@mastermo/stellar-wallet).

app.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"expo": {
3+
"name": "Stellar Wallet",
4+
"description":
5+
"Lightweight app to send and receive lumens over the Stellar network.",
6+
"slug": "stellar-wallet",
7+
"privacy": "unlisted",
8+
"sdkVersion": "23.0.0",
9+
"platforms": ["ios"],
10+
"version": "0.0.1",
11+
"orientation": "portrait",
12+
"icon": "./src/assets/icon.png",
13+
"splash": {
14+
"backgroundColor": "#ffffff"
15+
},
16+
"ios": {
17+
"supportsTablet": false
18+
}
19+
}
20+
}

global.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Inject node globals into React Native global scope.
2+
global.Buffer = require("buffer").Buffer;
3+
global.process = require("process");

jsconfig.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"compilerOptions": {
3+
"experimentalDecorators": true
4+
}
5+
}

0 commit comments

Comments
 (0)