Coder Social home page Coder Social logo

firegram's Introduction

firegram

Starter & final course files for the FireGram tutorial (React, Firebase & Framer Motion) on Brad Traversy's YouTube channel.

Link to video - https://www.youtube.com/watch?v=vUe91uOx7R0&t=652s

Using the files

  • To see the starter files, select the 'starter' branch.
  • To see the final files, select the 'final' branch.

firegram's People

Contributors

iamshaunjp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

firegram's Issues

ProgressBar issue

This is the error am getting after completing till the step of adding data into the firestore database and getting the URL in the firestore dashboard

basically its not giving any URL , and showing null , and gives this error in the console

index.js:1 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
at ProgressBar (http://localhost:3000/static/js/main.chunk.js:181:3)

import problem

./src/firebase/config.js
Attempted import error: 'firestore' is not exported from 'firebase/app' (imported as
'firebase').

Image upload issue

There is a bug in this application. If a user uploads an image with the same name firebase will send the same image twice.

Collection not being created.

The images are being uploaded to the Firebase Storage but upon checking the Firestore Database, there is no collection by the name 'images'. Collection is not being created at all, no matter how long I wait or how many images I upload.

I am copy pasting your code.

Images getting uploaded twice in firebase storage

Here is my code:
`import React from "react";
import { useState, useEffect } from "react";
import { firestore, storage } from "../firebase/config";
import { ref, uploadBytesResumable, getDownloadURL } from "firebase/storage";
import { addDoc, collection, serverTimestamp } from "firebase/firestore";

const useStorage = (file) => {
const [progress, setProgress] = useState(0);
const [error, setError] = useState(null);
const [url, setUrl] = useState(null);

useEffect(() => {
const storageRef = ref(storage, file.name);
const collectionRef = collection(firestore, "images");
const uploadTask = uploadBytesResumable(storageRef, file);
uploadTask.on(
"stage_changed",
(snapshot) => {
let percentage =
(snapshot.bytesTransferred / snapshot.totalBytes) * 100;
setProgress(percentage);
},
(error) => {
setError(error);
},
() => {
getDownloadURL(uploadTask.snapshot.ref).then((url) => {
const created = serverTimestamp();
addDoc(collectionRef, { url, created });
setUrl(url);
});
}
);
}, [file]);
return { url, progress, error };
};

export default useStorage;
`

Attempted import error

./src/firebase/config.js
Attempted import error: 'firebase' is not exported from 'firebase/app'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.