Skip to content
This repository has been archived by the owner on Jan 11, 2025. It is now read-only.

Commit

Permalink
[IMP] used profile component in profile container
Browse files Browse the repository at this point in the history
  • Loading branch information
alicalimli committed Nov 10, 2022
1 parent 965ddd1 commit 0724732
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/profile-picture/ProfilePicture.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

type sizesType = "small" | "medium" | "large";
type sizesType = "small" | "medium" | "large" | "x-large";

const DEFAULT_PROFILE_IMAGE = `https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRony1PUEAFW_rKWuriSeChlMZK05SNCoyhblOQpH5tBq1m5C_HHsKEJvveSdHRdSj_zJ4&usqp=CAU`;

Expand Down Expand Up @@ -33,6 +33,8 @@ const ProfilePicture = ({
return "w-14 h-14";
case "large":
return "w-16 h-16";
case "x-large":
return "w-24 h-24";
}
};

Expand Down
16 changes: 11 additions & 5 deletions src/features/profile/ProfileContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import { useEffect, useRef, useState } from "react";
import { AiOutlineArrowLeft, AiOutlineCamera } from "react-icons/ai";
import { HiOutlineLocationMarker, HiOutlineMail } from "react-icons/hi";
import { useAppDispatch, useAppSelector, useUploadImage } from "hooks";
import { Modal, TwTooltip, TwButton, LoadingSpinner } from "components";
import {
Modal,
TwTooltip,
TwButton,
LoadingSpinner,
ProfilePicture,
} from "components";
import { createToast } from "toastSlice";
import { editProfile, getUserState } from "features/authentication/userSlice";
import { changeSideContent, getSideContent } from "reducers/sideContentReducer";
Expand Down Expand Up @@ -82,10 +88,10 @@ const ProfileContainer = () => {

<section className="flex flex-col items-center text-center p-4 px-8">
<div className="group mb-2 relative flex items-center justify-center rounded-[50%] overflow-hidden">
<img
className="object-cover rounded-[50%] bg-white w-24 h-24 "
alt={`${user?.displayName}'s profile picture`}
src={user?.photoURL || ""}
<ProfilePicture
photoURL={user?.photoURL || ""}
isOnline={false}
size={"x-large"}
/>
{isImgPending && (
<LoadingSpinner
Expand Down

0 comments on commit 0724732

Please sign in to comment.