From 522caf6b1bb095e010318754daa6677afeba792a Mon Sep 17 00:00:00 2001
From: hamed <15238-genius.ha@users.noreply.drupalcode.org>
Date: Sat, 4 Jul 2026 23:02:20 +0330
Subject: [PATCH] feat: implement PosterLight component and enhance SiteLogo
functionality for improved poster rendering
---
components/doctor/detailDoctor/List.js | 5 +-
components/doctor/detailDoctor/Share.js | 39 ++++-
components/doctor/poster/PosterLight.js | 210 ++++++++++++++++++++++++
components/doctor/poster/SiteLogo.js | 31 ++++
components/doctor/poster/index.js | 37 +----
5 files changed, 290 insertions(+), 32 deletions(-)
create mode 100644 components/doctor/poster/PosterLight.js
create mode 100644 components/doctor/poster/SiteLogo.js
diff --git a/components/doctor/detailDoctor/List.js b/components/doctor/detailDoctor/List.js
index b304633..1621407 100644
--- a/components/doctor/detailDoctor/List.js
+++ b/components/doctor/detailDoctor/List.js
@@ -76,12 +76,13 @@ function List({ hiddenRef, data, qrReady }) {
try {
const fontEmbedCSS = await getVazirEmbedCss();
- imgData = await toPng(element, {
+ const options = {
pixelRatio: 2,
backgroundColor: "#ffffff",
style: { opacity: "1" },
fontEmbedCSS,
- });
+ };
+ imgData = await toPng(element, options);
pxWidth = element.offsetWidth * 2;
pxHeight = element.offsetHeight * 2;
} catch {
diff --git a/components/doctor/detailDoctor/Share.js b/components/doctor/detailDoctor/Share.js
index ac5ed98..709ec17 100644
--- a/components/doctor/detailDoctor/Share.js
+++ b/components/doctor/detailDoctor/Share.js
@@ -7,16 +7,29 @@ import { Box, Button, Modal } from "@mui/material";
import CloseModalD from "@/components/icons/CloseModalD";
import List from "./List";
import Poster from "../poster";
+import PosterLight from "../poster/PosterLight";
+
+const VARIANTS = [
+ { key: "dark", label: "طرح تیره", swatch: "linear-gradient(135deg,#0B2A4A,#2E77C4)" },
+ { key: "light", label: "طرح روشن", swatch: "linear-gradient(135deg,#FFFFFF,#CFE2F6)" },
+];
function Share({ data }) {
const hiddenRef = useRef();
const [open, setOpen] = useState(false);
const [qrReady, setQrReady] = useState(false);
+ const [variant, setVariant] = useState("dark");
const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false);
const handleQrReady = useCallback(() => setQrReady(true), []);
+ const changeVariant = (key) => {
+ if (key === variant) return;
+ setQrReady(false);
+ setVariant(key);
+ };
+
return (