feat(booking): give the booking flow a dark palette derived from its own colours
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>
This commit is contained in:
@@ -2,9 +2,9 @@ function Content({ isConfirmed, children, title }) {
|
||||
return (
|
||||
<div className="flex w-full flex-col items-start justify-start gap-[8px] sm:gap-[10px] md:gap-[13px] lg:gap-[16px]">
|
||||
<div className="flex min-h-[32px] items-center justify-start gap-[8px] md:gap-[6px] lg:gap-[4px]">
|
||||
<p className="text-[#525252] text-[14px] font-medium">{title}</p>
|
||||
<p className="text-[var(--ap-muted)] text-[14px] font-medium">{title}</p>
|
||||
{isConfirmed && (
|
||||
<p className="py-[4px] md:py-[2px] leading-[8px] sm:leading-[14px] md:leading-[21px] lg:leading-[28px] px-[5px] bg-[#05BA58] rounded-[40px] text-[#FFF] text-[10px] md:text-[12px] font-normal">
|
||||
<p className="py-[4px] md:py-[2px] leading-[8px] sm:leading-[14px] md:leading-[21px] lg:leading-[28px] px-[5px] bg-[#05BA58] rounded-[40px] text-[var(--ap-surface)] text-[10px] md:text-[12px] font-normal">
|
||||
تایید شده
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -27,8 +27,8 @@ function Form({ changeData, insurance, supplementaryInsurance, data, isForAnothe
|
||||
{isForAnother ? (
|
||||
<EditField changeData={changeData} data={data?.phone} name="phone" error={errors?.phone} />
|
||||
) : (
|
||||
<div className="flex items-center justify-between px-[14px] py-[12.5px] border border-[#D7D7D7] rounded-lg bg-[#F5F5F5]">
|
||||
<span className="text-[#3B3B3B]">{data?.phone?.value}</span>
|
||||
<div className="flex items-center justify-between px-[14px] py-[12.5px] border border-[var(--ap-border-2)] rounded-lg bg-[var(--ap-surface-3)]">
|
||||
<span className="text-[var(--ap-text)]">{data?.phone?.value}</span>
|
||||
<span className="text-[#4CAF50] text-[14px]">تایید شده</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -195,7 +195,7 @@ function SubmitData({ setStep, data, prevData, setErrors, doctor, isForAnother,
|
||||
onClick={handleSubmit}
|
||||
>
|
||||
<p
|
||||
className={`${loading && "opacity-0"} text-[#EFEFEF] text-[16px] font-medium`}
|
||||
className={`${loading && "opacity-0"} text-[var(--ap-border)] text-[16px] font-medium`}
|
||||
>
|
||||
ثبت اطلاعات
|
||||
</p>
|
||||
|
||||
@@ -78,10 +78,10 @@ function Detail({
|
||||
}, []);
|
||||
|
||||
return (
|
||||
// ${typePay === 'success' || typePay === 'failed' ? 'bg-transparent border-transparent md:bg-[#FFF] md:border-[#EFEFEF]' : ''}
|
||||
// ${typePay === 'success' || typePay === 'failed' ? 'bg-transparent border-transparent md:bg-[var(--ap-surface)] md:border-[var(--ap-border)]' : ''}
|
||||
<div className="w-full lg:w-[59%]">
|
||||
<div
|
||||
className={`opacity-page bg-[#FFF] border border-solid border-[#EFEFEF] rounded-[8px] p-[12px] sm:p-[16px] md:p-[20px] lg:p-[24px] `}
|
||||
className={`opacity-page bg-[var(--ap-surface)] border border-solid border-[var(--ap-border)] rounded-[8px] p-[12px] sm:p-[16px] md:p-[20px] lg:p-[24px] `}
|
||||
>
|
||||
{/* دکمه برگشت */}
|
||||
<div
|
||||
@@ -91,7 +91,7 @@ function Detail({
|
||||
<ArrowRightS />
|
||||
</div>
|
||||
|
||||
<p className="text-[#3B3B3B] text-[20px] font-bold">
|
||||
<p className="text-[var(--ap-text)] text-[20px] font-bold">
|
||||
{isForAnother ? "اطلاعات کاربر جدید" : "اطلاعات حساب کاربری"}
|
||||
</p>
|
||||
<Form
|
||||
@@ -107,7 +107,7 @@ function Detail({
|
||||
onClick={() => (isForAnother ? switchToSelf() : switchToAnother())}
|
||||
>
|
||||
<AddCircleBlueA />
|
||||
<p className="text-[#5559CE] text-[16px] font-medium">
|
||||
<p className="text-[var(--ap-primary)] text-[16px] font-medium">
|
||||
{isForAnother ? "نوبت برای خودم است" : "نوبت برای شخص دیگری است"}
|
||||
</p>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user