mirror of
https://github.com/R0m1k3/PleinR.git
synced 2026-10-18 12:47:56 +02:00
Logo en remplacement de la vitrine : centre et reduit (contain)
Quand un adherent n'a pas de photo de couverture mais un logo, le logo n'est plus etire en plein cadre : il est centre et contenu (~80%) sur fond blanc. Composant partage VitrineImage applique a l'annuaire, au carrousel d'accueil et a la fiche adherent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c15213c131
commit
aa63462eff
4 files changed
+85
-55
No files matched your search
@@ -4,6 +4,7 @@ import type { Metadata } from "next";
|
||||
import { Sparkle } from "@/components/Sparkle";
|
||||
import { SiteHeader } from "@/components/SiteHeader";
|
||||
import { SiteFooter } from "@/components/SiteFooter";
|
||||
import { VitrineImage } from "@/components/VitrineImage";
|
||||
import { getMemberLivePromotions, getPublicMember } from "@/lib/queries";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
@@ -96,25 +97,15 @@ export default async function FicheAdherentPage({
|
||||
|
||||
{/* cover + identity */}
|
||||
<section style={{ position: "relative", borderRadius: 22, overflow: "hidden", border: "1px solid #e6dcc6" }}>
|
||||
<div
|
||||
style={{
|
||||
position: "relative",
|
||||
height: 230,
|
||||
background: (member.coverUrl || member.logoUrl)
|
||||
? `url(${member.coverUrl || member.logoUrl})`
|
||||
: COVER_STRIPE,
|
||||
backgroundSize: "cover",
|
||||
backgroundPosition: "center",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
<VitrineImage
|
||||
coverUrl={member.coverUrl}
|
||||
logoUrl={member.logoUrl}
|
||||
height={230}
|
||||
stripe={COVER_STRIPE}
|
||||
placeholder="photo de couverture"
|
||||
>
|
||||
{!(member.coverUrl || member.logoUrl) && (
|
||||
<span style={{ fontSize: 11, letterSpacing: "0.14em", color: "#b3a888", textTransform: "uppercase" }}>photo de couverture</span>
|
||||
)}
|
||||
<Sparkle color={accent} size={20} style={{ top: 20, right: 24 }} duration={3.2} />
|
||||
</div>
|
||||
</VitrineImage>
|
||||
<div style={{ background: "#fff", padding: "0 30px 26px", display: "flex", alignItems: "flex-end", gap: 22, flexWrap: "wrap" }}>
|
||||
<div
|
||||
style={{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useMemo, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import { VitrineImage } from "@/components/VitrineImage";
|
||||
|
||||
export type DirectoryMember = {
|
||||
id: number;
|
||||
@@ -190,7 +191,6 @@ export function AnnuaireClient({
|
||||
{list.length > 0 ? (
|
||||
<div className="grid grid-3" style={{ gap: 20 }}>
|
||||
{list.map((m, i) => {
|
||||
const image = m.coverUrl || m.logoUrl;
|
||||
return (
|
||||
<Link
|
||||
key={m.id}
|
||||
@@ -198,23 +198,12 @@ export function AnnuaireClient({
|
||||
className="lift-card"
|
||||
style={{ textDecoration: "none", color: "inherit", background: "#fff", border: "1px solid #e6dcc6", borderRadius: 18, overflow: "hidden", display: "flex", flexDirection: "column" }}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
position: "relative",
|
||||
height: 150,
|
||||
background: image
|
||||
? `center/cover no-repeat url(${image})`
|
||||
: i % 2 === 0 ? STRIPE_WARM : STRIPE_COOL,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
}}
|
||||
<VitrineImage
|
||||
coverUrl={m.coverUrl}
|
||||
logoUrl={m.logoUrl}
|
||||
height={150}
|
||||
stripe={i % 2 === 0 ? STRIPE_WARM : STRIPE_COOL}
|
||||
>
|
||||
{!image && (
|
||||
<span style={{ fontSize: 10, letterSpacing: "0.12em", color: "#a99c82", textTransform: "uppercase" }}>
|
||||
photo vitrine
|
||||
</span>
|
||||
)}
|
||||
{m.categoryLabel && (
|
||||
<span style={{ position: "absolute", top: 12, left: 12, background: m.accent ?? "#9a6638", color: "#fff", borderRadius: 999, padding: "5px 12px", fontSize: 11, fontWeight: 700 }}>
|
||||
{m.categoryLabel}
|
||||
@@ -225,7 +214,7 @@ export function AnnuaireClient({
|
||||
{m.promoBadge}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</VitrineImage>
|
||||
<div style={{ padding: "16px 18px 18px", display: "flex", flexDirection: "column", flex: 1 }}>
|
||||
<h3 className="font-display" style={{ fontWeight: 700, fontSize: 18, margin: 0, color: "#26201a" }}>
|
||||
{m.name}
|
||||
|
||||
Reference in new issue
Block a user