Skip to content

Commit

Permalink
feature added profile pic to header. Cleaned up some code
Browse files Browse the repository at this point in the history
  • Loading branch information
ROSSROSALES committed Aug 9, 2023
1 parent d466534 commit 9c0aca6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 28 deletions.
18 changes: 9 additions & 9 deletions .firebase/hosting.YnVpbGQ.cache
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ logo192.png,1665354843807,3ee59515172ee198f3be375979df15ac5345183e656720a381b887
logo512.png,1665354843808,ee7e2f3fdb8209c4b6fd7bef6ba50d1b9dba30a25bb5c3126df057e1cb6f5331
manifest.json,1665354843808,5c997de1364b8be939319fa9209abd77f2caf7f8844999a9e2e9173f844e7840
robots.txt,1665354843809,b2090cf9761ef60aa06e4fab97679bd43dfa5e5df073701ead5879d7c68f1ec5
asset-manifest.json,1667007336869,1bc4f880dde73c2e497e9ff61fcd92ebf4ff018082d48c5b75410d352802750a
index.html,1667007336869,e16ab8dc1981c550f5c65a5006ec1b4d5deb1b941814483b36ce9eb2d63bd1b6
static/js/787.1583e544.chunk.js,1667007336884,8af2baeb24f579297dedfea57ed17f2c85f6bd0a1fda19f030e80031c0bf3bb0
static/css/main.96173131.css.map,1667007336884,2e1acc67b72d5be4458ef77aa0b85e62c9ae7be010817cc58a03c9d19732b882
static/js/787.1583e544.chunk.js.map,1667007336884,f81d2b4464179ec15df3380d732b71d987e624b5fc91e23e43c0be1fd21819a7
static/js/main.a0a93df1.js.LICENSE.txt,1667007336884,4f35a1289934fb45d3feae9333f9dbeaa8ec67f3f9f16633535ee89c6a60a3b9
static/css/main.96173131.css,1667007336884,8b9a9d0baa59bd41593610c04f4eab7df0284828539a76de16b8c10f0b85ffad
static/js/main.a0a93df1.js,1667007336884,e1c19b56b77b31dbb70ef2a6651a023126e37bca938ff6d50fe358099cb8aa30
static/js/main.a0a93df1.js.map,1667007336886,258597fb95a3635744343eecdd63cdd49afae56f5b59873d0c9381793e574df5
asset-manifest.json,1691552216560,8608b156d80921b84279c9f55449cd1e70e621279d8926b4229137dc52850031
index.html,1691552216560,e545d75e16d7ac3dc9c4b18a1b5e96271bc034356d766a98a1ee8a4bf47f92b3
static/css/main.96173131.css,1691552216574,8b9a9d0baa59bd41593610c04f4eab7df0284828539a76de16b8c10f0b85ffad
static/css/main.96173131.css.map,1691552216575,2e1acc67b72d5be4458ef77aa0b85e62c9ae7be010817cc58a03c9d19732b882
static/js/787.1583e544.chunk.js,1691552216574,8af2baeb24f579297dedfea57ed17f2c85f6bd0a1fda19f030e80031c0bf3bb0
static/js/787.1583e544.chunk.js.map,1691552216575,f81d2b4464179ec15df3380d732b71d987e624b5fc91e23e43c0be1fd21819a7
static/js/main.8a5a7493.js.LICENSE.txt,1691552216575,4f35a1289934fb45d3feae9333f9dbeaa8ec67f3f9f16633535ee89c6a60a3b9
static/js/main.8a5a7493.js,1691552216575,d6720c9b67863271c0ee657f34178edb863bbcd894f975b3073eae8acf984e8e
static/js/main.8a5a7493.js.map,1691552216577,f515ecfc08cd391acae02330a4825bd98771c964668e33e23aaf964643697176
20 changes: 9 additions & 11 deletions src/Components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import LoadingScreen from "./Loading";
import History from "./History";
import { SignIn } from "./SignIn";

import { makeStyles } from "@material-ui/styles";
import { BrowserRouter as Router, Route, Routes} from "react-router-dom";
import React, { useState, useEffect } from 'react';
import "./App.css";
Expand Down Expand Up @@ -47,31 +46,30 @@ import { useAuthState } from 'react-firebase-hooks/auth';
//});

function App() {
// add lock to check for api response before showing data
const [loading, setLoading] = useState(true)

useEffect(() => {
setTimeout(() => setLoading(false), 6000)
setTimeout(() => setLoading(false), 1600)
}, [])

const [user] = useAuthState(auth);

//console.log(user.email)

useEffect(() => {
async function sendMessage(e) {
e.preventDefault();
const { photoURL } = auth.currentUser;
}
}, [user])
//useEffect(() => {
// async function sendMessage(e) {
// e.preventDefault();
// const { photoURL } = auth.currentUser;
// }
//}, [user])

//const classes = useStyles();

return (
<>
{loading === false ? (
<Router>

<Header auth = { auth } /*photoURL= { photoURL }*//>
<Header auth = { auth } />
<Routes>

<Route path="/chat" element={user ? <Chat /> : <SignIn />}>
Expand Down
9 changes: 6 additions & 3 deletions src/Components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import MenuItem from '@mui/material/MenuItem';
import BlenderIcon from '@mui/icons-material/Blender';
import { Link } from "react-router-dom";

import { auth } from "../firebase";

import { SignOut } from "../firebase";


Expand Down Expand Up @@ -51,14 +53,15 @@ const settings = [

function Header(props) {


const {photoURL} = props;
const { photoURL } = auth.currentUser;
//const {photoURL} = props;

const [anchorElNav, setAnchorElNav] = useState(null);
const [anchorElUser, setAnchorElUser] = useState(null);

function handleOpenNavMenu(event) {
console.log(event.currentTarget)
console.log("This opens the menu")
setAnchorElNav(event.currentTarget);
};

Expand Down Expand Up @@ -133,7 +136,7 @@ function Header(props) {
>
{pages.map((page) => (
<Link to={page.path}>
<MenuItem key={page.title} onClick={handleCloseNavMenu}>
<MenuItem key={page.title} onClick={() => {handleCloseNavMenu(); handleLinkClick();}}>
<Typography textAlign="center" color="black" >{page.title}</Typography>
</MenuItem>
</Link>
Expand Down
10 changes: 5 additions & 5 deletions src/Components/TinderCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const useStyles = makeStyles({

const anime_array = []
function response() {
fetch("https://api.jikan.moe/v4/top/anime")
fetch("https://api.jikan.moe/v4/top/anime?page=2&limit=25")
.then(response => response.json())
.then(function(result) {
for (var i=0; i<result.data.length; i++) {
Expand All @@ -68,10 +68,10 @@ function response() {
// console.log(anime_array)
//}
}
console.log("this is the curr user", auth.currentUser)
const { uid, photoURL } = auth.currentUser;
console.log("This is uid", uid)
console.log("this is profileURL", photoURL)
//console.log("this is the curr user", auth.currentUser)
//const { uid, photoURL } = auth.currentUser;
//console.log("This is uid", uid)
//console.log("this is profileURL", photoURL)
//console.log(firestore)
})
.catch(error => console.error(error));
Expand Down

0 comments on commit 9c0aca6

Please sign in to comment.