Skip to content

Commit

Permalink
Fix dumbass craco config file failing the ESLint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SherRao committed Jul 22, 2021
1 parent e0be788 commit 8109d16
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 14 deletions.
1 change: 1 addition & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */
const path = require("path");

module.exports = {
Expand Down
File renamed without changes
3 changes: 1 addition & 2 deletions src/assets/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Icon from "./icon.svg";
import Logo from "./logo.svg";
import testProfPic from "./testProfPic.jpg";
import DefaultCover from "./DefaultCover.png";

export { Icon, Logo, testProfPic, DefaultCover };
export { Icon, Logo, DefaultCover };
31 changes: 23 additions & 8 deletions src/components/organisms/LeaderBoard.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { Component } from "react";
import Styled from "styled-components";

import { LeaderBoardLabel, LeaderBoardStat } from "@atoms";
import { testProfPic } from "@assets";
import { Firebase } from "@functions";

const StyledDiv = Styled.div`
color:${props => props.theme.colors.black};
Expand Down Expand Up @@ -48,21 +48,36 @@ const StyledText = Styled.p`
`;

function LeaderBoard({ text }){
const [profilePic, setProfilePic ] = React.useState(null);
const user = Firebase.auth.currentUser;

React.useEffect(() => {
if(!profilePic)
getProfilePic();

}, []);

async function getProfilePic() {
const x = await Firebase.db.collection("users").doc(user.uid).get("profile_picture");
setProfilePic(x);

}

return (
<StyledDiv>
<StyledText>Leaderboard</StyledText>
<StyledInnerDiv>
<LeaderBoardLabel text="Top Listening Hours:"/>
<StyledInnerDiv>
<LeaderBoardStat number={1} username="username" hours={1337} href="/" src={testProfPic}></LeaderBoardStat>
<LeaderBoardStat number={2} username="username" hours={420} href="/" src={testProfPic}></LeaderBoardStat>
<LeaderBoardStat number={3} username="username" hours={69} href="/" src={testProfPic}></LeaderBoardStat>
<LeaderBoardStat number={1} username="username" hours={1337} href="/" src={profilePic}></LeaderBoardStat>
<LeaderBoardStat number={2} username="username" hours={420} href="/" src={profilePic}></LeaderBoardStat>
<LeaderBoardStat number={3} username="username" hours={69} href="/" src={profilePic}></LeaderBoardStat>
</StyledInnerDiv>
<LeaderBoardLabel text="Number of Unique Artists:"/>
<StyledInnerDiv>
<LeaderBoardStat number={1} username="username" hours={96} href="/" src={testProfPic}></LeaderBoardStat>
<LeaderBoardStat number={2} username="username" hours={69} href="/" src={testProfPic}></LeaderBoardStat>
<LeaderBoardStat number={3} username="username" hours={69} href="/" src={testProfPic}></LeaderBoardStat>
<LeaderBoardStat number={1} username="username" hours={96} href="/" src={profilePic}></LeaderBoardStat>
<LeaderBoardStat number={2} username="username" hours={69} href="/" src={profilePic}></LeaderBoardStat>
<LeaderBoardStat number={3} username="username" hours={69} href="/" src={profilePic}></LeaderBoardStat>
</StyledInnerDiv>
</StyledInnerDiv>
</StyledDiv>
Expand Down
20 changes: 17 additions & 3 deletions src/components/organisms/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,22 @@ const StyledText = Styled.h1`
`;

function Sidebar() {
const username = Firebase.auth.currentUser.displayName;
const profilePicture = Firebase.auth.currentUser.photoURL;
const [profilePic, setProfilePic ] = React.useState(null);

const user = Firebase.auth.currentUser;
const username = user.displayName;

React.useEffect(() => {
if(!profilePic)
getProfilePic();

}, []);

async function getProfilePic() {
const x = await Firebase.db.collection("users").doc(user.uid).get("profile_picture");
setProfilePic(x);

}

return (
<StyledDiv>
Expand Down Expand Up @@ -63,7 +77,7 @@ function Sidebar() {
<UserButton
text={username}
location="/settings"
profileImage={profilePicture}
profileImage={profilePic}
>
</UserButton>
</StyledDiv>
Expand Down
3 changes: 2 additions & 1 deletion src/functions/Firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ async function storeNewUserData(id, email, firstName, lastName, username, dob) {
"firstName": firstName,
"lastName": lastName,
"username": username,
"dob": dob
"dob": dob,
"profile_picture": "https://firebasestorage.googleapis.com/v0/b/cp-317.appspot.com/o/default_profile.jpg?alt=media&token=4ed26d80-388b-4814-95b3-01740138285a"
};

await db.collection("users")
Expand Down

0 comments on commit 8109d16

Please sign in to comment.