Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat]: Introduce Profile Preview Functionality for Followers #113 #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/components/CardTabs/Users/UserElement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState } from "react";
import Box from "@mui/material/Box";
import AddUser from "../../../assets/images/add-user.svg";
import CheckUser from "../../../assets/images/square-check-regular.svg";
import { Link } from "react-router-dom"

const UserElement = ({ user, index, useStyles }) => {
const classes = useStyles();
Expand All @@ -17,6 +18,7 @@ const UserElement = ({ user, index, useStyles }) => {
}}
gutterBottom
>
<Link to={`/profile/${user.uid}`}>
<Box
sx={{
display: "flex",
Expand All @@ -25,26 +27,30 @@ const UserElement = ({ user, index, useStyles }) => {
cursor: "pointer"
}}
>

<img
src={user.img[0]}
src={user.photoURL || user.img || "https://i.pravatar.cc/300"}
className={classes.userImg}
data-testId={index == 0 ? "UsersCardImg" : ""}
/>

<Box sx={{ flexGrow: 1 }}>
<Box
sx={{ fontWeight: 600, fontSize: "1rem" }}
data-testId={index == 0 ? "UserName" : ""}
>
{user.name}
{user.displayName || user.name}
</Box>
<Box
sx={{ fontWeight: 400, fontSize: "0.8rem" }}
data-testId={index == 0 ? "UserDesg" : ""}
>
{user.desg}
{user.handle || user.desg}
</Box>
</Box>

</Box>
</Link>
<Box
onClick={() => {
setIcon(false);
Expand Down
Loading