Skip to content

Instantly share code, notes, and snippets.

View arshadazaad3's full-sized avatar
📜
Migrating

Arshad Azaad arshadazaad3

📜
Migrating
View GitHub Profile
@arshadazaad3
arshadazaad3 / imageUploadFirebase.js
Created August 25, 2022 01:46
React Native Firebase Upload Image
uploadImage = () => {
const ext = this.state.imageUri.split('.').pop(); // Extract image extension
const filename = `${uuid()}.${ext}`; // Generate unique name
this.setState({ uploading: true });
firebase
.storage()
.ref(`common/images/${filename}`)
.putFile(this.state.imageUri)
.on(
firebase.storage.TaskEvent.STATE_CHANGED,
@arshadazaad3
arshadazaad3 / imageUploadWithActionSheet.js
Created August 25, 2022 01:43
React Native Image Upload With Action Sheet
import React, { useState } from "react";
import { Platform, SafeAreaView, ScrollView, TouchableOpacity, View } from "react-native";
import { Stack, Text, Actionsheet, Image } from "native-base";
import DocumentPicker from "react-native-document-picker";
import LinearGradient from "react-native-linear-gradient";
import { scale } from "react-native-size-matters";
import Toast from "react-native-toast-message";
import PropTypes from "prop-types";
/**