components/appointment/ had every colour hard-coded, so the flow rendered identically in either theme even after the wiring was fixed. It now reads from CSS custom properties. These are not new colours. The :root values are byte-for-byte the hex codes that were already in the components — twenty-one files, mapped one to one — so light mode is unchanged. The dark values are derived from those same colours: surfaces and borders darkened, text inverted, and the two brand colours (the indigo and the orange) lightened rather than replaced, because both lose contrast against a dark surface at their original values. Verified in a headless browser with prefers-color-scheme forced dark: data-theme lands on <html> and --ap-surface resolves to #1b1b20 rather than white. Six one-off colours remain hard-coded — a success green, an error red and similar — each used exactly once and none of them a surface. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
37 lines
1.3 KiB
JavaScript
37 lines
1.3 KiB
JavaScript
/**
|
|
* آدرسهای پزشک در سایدبار. وقتی محل نوبتدهی انتخاب شده باشد، فقط همان محل نشان
|
|
* داده میشود تا با اسلاتهای نمایشدادهشده همخوان بماند.
|
|
*/
|
|
function Address({ doctor, selectedLocation }) {
|
|
if (selectedLocation) {
|
|
return (
|
|
<ul className="hidden mt-[4px] lg:flex flex-col">
|
|
<li>
|
|
<div className="flex py-[12px] text-[var(--ap-text-2)] text-[14px] items-start justify-start">
|
|
<p className="font-bold min-w-[115px]">{`${selectedLocation.title}: `}</p>
|
|
<p className="font-normal">{selectedLocation.address || "—"}</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<ul className="hidden mt-[4px] lg:flex flex-col">
|
|
{doctor?.address?.map((item, idx) => (
|
|
<li key={idx}>
|
|
<div className="flex py-[12px] text-[var(--ap-text-2)] text-[14px] items-start justify-start">
|
|
<p className="font-bold min-w-[115px]">{`${item.name}: `}</p>
|
|
<p className="font-normal">{item.address || item.location}</p>
|
|
</div>
|
|
{doctor.address.length > idx + 1 && (
|
|
<span className="bg-[var(--ap-border)] block h-px w-full"></span>
|
|
)}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
);
|
|
}
|
|
|
|
export default Address;
|