Browse Source

wip commit

Ben Hsieh 8 years ago
parent
commit
dea4ad411a
2 changed files with 25 additions and 0 deletions
  1. 10
    0
      src/components/Fetch.onPress.js
  2. 15
    0
      src/components/Fetch.when.js

+ 10
- 0
src/components/Fetch.onPress.js View File

@@ -0,0 +1,10 @@
1
+// press button to login
2
+{/*<Fetch.onPress method="POST"
3
+  url="www.example.com/login"
4
+  body={this.state.body}
5
+  onSuccess={this.onSuccess}
6
+  onError={this.showError}>
7
+  <View>
8
+  	<Text>Click to Login</Text>
9
+  </View>
10
+</LoginAction.onPress>*/}

+ 15
- 0
src/components/Fetch.when.js View File

@@ -0,0 +1,15 @@
1
+// placeholder
2
+{/*<Fetch method="GET"
3
+  url={`www.example.com/avatar/${this.state.userId}`}
4
+  onSuccess={(data) => { this.setState({avatar : data.path()}) }}
5
+  onError={this.showError}>
6
+  <Fetch.before>
7
+		<Image souce="images/placeholder.png"/>
8
+	</Fetch.before>
9
+  <Fetch.success>
10
+		<Image souce={this.state.avatar}/>
11
+	</Fetch.success>
12
+  <Fetch.error>
13
+		<Image souce="images/error.png"/>
14
+	</Fetch.error>
15
+</LoginAction.onPress>*/}