Skip to content

Commit

Permalink
feat: use id to get profile pic
Browse files Browse the repository at this point in the history
  • Loading branch information
thenicekat committed Apr 27, 2024
1 parent 3fa5a74 commit 104a835
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions backend/src/routes/user.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ userRouter.get("/get", async (req, res) => {
error: false,
message: "User data fetched successfully",
data: {
id: userData.id,
email: userData.email,
phoneNumber: userData.phoneNumber,
name: userData.name,
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ const AdminHomepage = () => {
<div key={index}>
<div className="flex flex-col gap-2">
<img
src={`https://api.dicebear.com/7.x/notionists/svg?seed=${user.email}&size=40&radius=0&scale=100`}
src={`https://api.dicebear.com/7.x/notionists/svg?seed=${user.id}&size=40&radius=0&scale=100`}
className='rounded-full border-2 w-32 h-32 border-green-500 mx-auto'
alt="avatar"
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/user/details/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const UserDetailsPage = ({ params }: Props) => {
<div className="flex flex-col gap-2 m-2">
<div className="flex flex-col gap-2">
<img
src={`https://api.dicebear.com/7.x/notionists/svg?seed=${userDetails.email}&size=50&radius=0`}
src={`https://api.dicebear.com/7.x/notionists/svg?seed=${userDetails.id}&size=50&radius=0`}
className='rounded-full border-2 w-32 h-32 border-green-500 mx-auto'
alt="avatar"
/>
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/user/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Chip } from "@nextui-org/chip";
import React from "react";

type UserProfile = {
id: string;
name: string;
email: string;
phoneNumber: string;
Expand Down Expand Up @@ -122,7 +123,7 @@ export default function UserProfile() {
control={control}
>
<img
src={`https://api.dicebear.com/7.x/notionists/svg?seed=${userData?.email}&size=50&radius=0`}
src={`https://api.dicebear.com/7.x/notionists/svg?seed=${userData?.id}&size=50&radius=0`}
className='rounded-full border-2 w-32 h-32 border-green-500 mx-auto'
alt="avatar"
/>
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function PostComponent({
<Card className="w-full m-3">
<CardHeader className="flex gap-3 flex-row">
<img
src={`https://api.dicebear.com/7.x/notionists/svg?seed=${author.email}&size=40&radius=0&scale=100`}
src={`https://api.dicebear.com/7.x/notionists/svg?seed=${author.id}&size=40&radius=0&scale=100`}
alt="avatar"
/>
<div className="flex flex-col">
Expand Down

0 comments on commit 104a835

Please sign in to comment.