mirror of
https://github.com/IliesAllali/parenthese.git
synced 2026-11-06 23:32:08 +00:00
Merge pull request #130 from IliesAllali/fix/fiche-sans-ajout-photo
Fiche sans bouton d'ajout de photo, rond du compte bien rond
This commit is contained in:
3 files changed
+9
-29
No files matched your search
@@ -44,16 +44,6 @@
|
||||
}
|
||||
.pc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||
.pc-photo-initials { font: 400 30px/1 var(--pz-serif); color: var(--pz-a700); }
|
||||
.pc-photo--add {
|
||||
border: 1.5px dashed var(--pz-a300); background: var(--pz-a50); box-shadow: none; cursor: pointer;
|
||||
align-content: center; gap: 5px; padding: 6px; color: var(--pz-a700);
|
||||
font: 500 11.5px/1.15 var(--pz-sans); text-align: center;
|
||||
transition: background-color 160ms ease, border-color 160ms ease, transform 140ms var(--pz-ease);
|
||||
}
|
||||
@media (hover: hover) and (pointer: fine) { .pc-photo--add:hover { background: var(--pz-a100); border-color: var(--pz-a500); } }
|
||||
.pc-photo--add:active:not(:disabled) { transform: scale(.97); }
|
||||
.pc-photo--add:focus-visible { outline: 2px solid var(--pz-a500); outline-offset: 3px; }
|
||||
.pc-photo--add:disabled { opacity: .6; cursor: default; }
|
||||
/* Menu du choix de source du portrait : au-dessus de la fiche (z-index 1000), sous la modale Immich (2200) */
|
||||
.pc-source-backdrop { position: fixed; inset: 0; z-index: 1100; }
|
||||
.pc-source-menu { position: fixed; z-index: 1150; min-width: 220px; }
|
||||
|
||||
@@ -688,25 +688,12 @@ const PersonCard = ({
|
||||
disabled={avatarActionLoading}
|
||||
/>
|
||||
)}
|
||||
{/* Portrait vide chez le propriétaire : le cadre lui-même invite à poser la photo, sans passer par l'édition */}
|
||||
{!person.photo && onAvatarUpload && !editMode ? (
|
||||
<button
|
||||
type="button"
|
||||
className="pc-photo pc-photo--add"
|
||||
onClick={() => avatarInputRef.current?.click()}
|
||||
disabled={avatarActionLoading}
|
||||
aria-label={t('Ajouter une photo')}
|
||||
title={t('Ajouter une photo')}
|
||||
>
|
||||
<ImagePlus size={22} strokeWidth={1.8} aria-hidden="true" />
|
||||
</button>
|
||||
) : (
|
||||
<div className="pc-photo">
|
||||
{person.photo
|
||||
? <img src={person.photo} alt={fullNameLabel(person)} onLoad={(event) => setPhotoSize({ w: event.currentTarget.naturalWidth, h: event.currentTarget.naturalHeight })} style={photoStyle} />
|
||||
: <span className="pc-photo-initials">{initials}</span>}
|
||||
</div>
|
||||
)}
|
||||
{/* Hors modification, le portrait se regarde : la photo s'ajoute ou se change en mode modification */}
|
||||
<div className="pc-photo">
|
||||
{person.photo
|
||||
? <img src={person.photo} alt={fullNameLabel(person)} onLoad={(event) => setPhotoSize({ w: event.currentTarget.naturalWidth, h: event.currentTarget.naturalHeight })} style={photoStyle} />
|
||||
: <span className="pc-photo-initials">{initials}</span>}
|
||||
</div>
|
||||
{editMode && onAvatarUpload && (
|
||||
<button
|
||||
ref={sourceBtnRef}
|
||||
|
||||
@@ -89,7 +89,10 @@
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* Posée sur le rond : en cellule de grille, height: 100% suivait la hauteur naturelle de la photo (ovale) */
|
||||
.nav-avatar-photo {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
|
||||
Reference in new issue
Block a user