Last active
September 14, 2020 12:05
-
-
Save yoavniran/94b0c5c5a90461db77937b99bd78e67f to your computer and use it in GitHub Desktop.
react-native uploady demo - app
This file contains hidden or 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
import React, { useState, useCallback, useContext } from "react"; | |
import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar, Button, ImageBackground, Image } from "react-native"; | |
import DocumentPicker from "react-native-document-picker/index"; | |
import NativeUploady, { | |
UploadyContext, | |
useItemFinishListener, | |
useItemStartListener, | |
useItemErrorListener, | |
} from "@rpldy/native-uploady"; | |
const App = () => { | |
return ( | |
<> | |
<NativeUploady | |
destination={{ url: "https://my-server.test.com/upload" }}> | |
<SafeAreaView> | |
<ScrollView contentInsetAdjustmentBehavior="automatic"> | |
<ImageBackground | |
accessibilityRole={"image"} | |
source={require("./logo.png")} | |
style={styles.headerBackground} | |
imageStyle={styles.headerLogo} | |
> | |
<Text style={styles.headerText}>Welcome to React-Uploady</Text> | |
</ImageBackground> | |
<View style={styles.body}> | |
<View style={styles.sectionContainer}> | |
<Text style={styles.sectionTitle}>Upload File</Text> | |
</View> | |
</View> | |
</ScrollView> | |
</SafeAreaView> | |
<Upload/> | |
</NativeUploady> | |
</> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment