consistent profile image, initials with background color as backup, better profile image editing

This commit is contained in:
jackiettran
2025-12-12 23:08:54 -05:00
parent 3f319bfdd0
commit 55e08e14b8
11 changed files with 196 additions and 184 deletions

View File

@@ -2,6 +2,7 @@ import React, { useState } from "react";
import { rentalAPI } from "../services/api";
import { Rental } from "../types";
import SuccessModal from "./SuccessModal";
import Avatar from "./Avatar";
interface ReviewItemModalProps {
show: boolean;
@@ -102,26 +103,7 @@ const ReviewItemModal: React.FC<ReviewItemModalProps> = ({
{rental.owner && rental.item && (
<div className="mb-4 text-center">
<div className="d-flex justify-content-center mb-3">
{rental.owner.imageFilename ? (
<img
src={rental.owner.imageFilename}
alt={`${rental.owner.firstName} ${rental.owner.lastName}`}
className="rounded-circle"
style={{
width: "60px",
height: "60px",
objectFit: "cover",
}}
/>
) : (
<div
className="rounded-circle bg-primary d-flex align-items-center justify-content-center text-white fw-bold"
style={{ width: "60px", height: "60px" }}
>
{rental.owner.firstName[0]}
{rental.owner.lastName[0]}
</div>
)}
<Avatar user={rental.owner} size="xl" />
</div>
<h6 className="mb-1">
{rental.owner.firstName} {rental.owner.lastName}