fix: team editor layout — compact header with photo matching field height
- Photo 150px wide, stretches to match fields height (no empty space) - Profile header: photo + name/role/instagram inline - Full-width descriptions and biography below - Remove extra closing div that caused TS error
This commit is contained in:
@@ -257,17 +257,15 @@ function TeamMemberEditor() {
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
<div className="mt-6 flex gap-6 items-start">
|
||||
{/* Photo */}
|
||||
<div className="shrink-0">
|
||||
<p className="text-sm text-neutral-400 mb-2">Фото</p>
|
||||
<label className="relative block w-[130px] aspect-[3/4] overflow-hidden rounded-xl border border-white/10 cursor-pointer group">
|
||||
{/* Profile header: photo + name/role/instagram */}
|
||||
<div className="mt-6 flex gap-5 items-start">
|
||||
<label className="relative shrink-0 block w-[150px] self-stretch overflow-hidden rounded-xl border border-white/10 cursor-pointer group">
|
||||
<Image
|
||||
src={data.image}
|
||||
alt={data.name || "Фото"}
|
||||
fill
|
||||
className="object-cover"
|
||||
sizes="130px"
|
||||
sizes="150px"
|
||||
priority
|
||||
/>
|
||||
<div className="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex flex-col items-center justify-center gap-1">
|
||||
@@ -276,21 +274,14 @@ function TeamMemberEditor() {
|
||||
) : (
|
||||
<>
|
||||
<Upload size={20} className="text-white" />
|
||||
<span className="text-[11px] text-white/80">Изменить фото</span>
|
||||
<span className="text-[11px] text-white/80">Изменить</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<input
|
||||
type="file"
|
||||
accept="image/*"
|
||||
onChange={handleUpload}
|
||||
className="hidden"
|
||||
/>
|
||||
<input type="file" accept="image/*" onChange={handleUpload} className="hidden" />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{/* Fields */}
|
||||
<div className="space-y-4">
|
||||
<div className="flex-1 space-y-3">
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<InputField
|
||||
label="Имя"
|
||||
@@ -331,7 +322,7 @@ function TeamMemberEditor() {
|
||||
validateInstagram(username);
|
||||
}}
|
||||
placeholder="username"
|
||||
className={`w-full rounded-lg border bg-neutral-800 pl-8 pr-10 py-2.5 text-white placeholder-neutral-500 outline-none transition-colors ${
|
||||
className={`w-full rounded-lg border bg-neutral-800 pl-8 pr-10 py-2.5 text-white placeholder-neutral-500 outline-none hover:border-gold/30 transition-colors ${
|
||||
igStatus === "invalid"
|
||||
? "border-red-500 focus:border-red-500"
|
||||
: igStatus === "valid"
|
||||
@@ -352,6 +343,11 @@ function TeamMemberEditor() {
|
||||
<p className="mt-1 text-xs text-neutral-500">instagram.com/{data.instagram}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Full-width fields */}
|
||||
<div className="mt-6 space-y-4">
|
||||
<TextareaField
|
||||
label="Краткое описание (для карточки)"
|
||||
value={data.shortDescription}
|
||||
@@ -411,6 +407,6 @@ function TeamMemberEditor() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user