Skip to content

Instantly share code, notes, and snippets.

@yoavniran
Last active September 14, 2020 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoavniran/94b0c5c5a90461db77937b99bd78e67f to your computer and use it in GitHub Desktop.
Save yoavniran/94b0c5c5a90461db77937b99bd78e67f to your computer and use it in GitHub Desktop.
react-native uploady demo - app
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