Lessons and packages headers: back to the owner's preferred colors (green, coral), exactly as before

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:31:01 +03:30
parent 54bd865835
commit 54b872026d
3 changed files with 7 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ export function ScreenHeader({
color, color,
back = false, back = false,
mascot, mascot,
exact = false,
children, children,
}: { }: {
title: ReactNode; title: ReactNode;
@@ -22,11 +23,13 @@ export function ScreenHeader({
/** دکمه‌ی بازگشت؛ true یعنی صفحه‌ی قبل در پشته. */ /** دکمه‌ی بازگشت؛ true یعنی صفحه‌ی قبل در پشته. */
back?: boolean | (() => void); back?: boolean | (() => void);
mascot?: { char: SeyarChar; mood?: SeyarMood; size?: number }; mascot?: { char: SeyarChar; mood?: SeyarMood; size?: number };
/** رنگ را همان‌طور که هست بگذار (بی‌تیره‌کردن برای کنتراست)؛ انتخابِ مالک برای چند صفحه. */
exact?: boolean;
children?: ReactNode; children?: ReactNode;
}) { }) {
const nav = useNav(); const nav = useNav();
const onBack = typeof back === 'function' ? back : nav.back; const onBack = typeof back === 'function' ? back : nav.back;
const bg = onWhite(color); const bg = exact ? color : onWhite(color);
return ( return (
<header <header
className="relative flex-shrink-0 overflow-hidden rounded-b-[32px] px-5 pb-6 pt-safe text-white" className="relative flex-shrink-0 overflow-hidden rounded-b-[32px] px-5 pb-6 pt-safe text-white"

View File

@@ -37,7 +37,8 @@ export function LessonsScreen() {
<ScreenHeader <ScreenHeader
title="درس‌ها" title="درس‌ها"
subtitle={<>{gradeTitle && <>{gradeTitle}<Sep /></>}اول بخون، بعد آزمونِ جزیره رو بده</>} subtitle={<>{gradeTitle && <>{gradeTitle}<Sep /></>}اول بخون، بعد آزمونِ جزیره رو بده</>}
color="#97C0C0" color="#2FB36B"
exact
mascot={{ char: 'sigma', mood: 'happy' }} mascot={{ char: 'sigma', mood: 'happy' }}
> >
{home && totalNodes > 0 && ( {home && totalNodes > 0 && (

View File

@@ -37,7 +37,7 @@ export function SubscriptionScreen() {
return ( return (
<Screen> <Screen>
<div className="flex-1 overflow-y-auto"> <div className="flex-1 overflow-y-auto">
<ScreenHeader title="بسته‌ی سوال" subtitle="هر وقت لازم داشتی، سوال بخر" color="#4C5FD5" mascot={{ char: 'pi', mood: 'excited', size: 60 }} /> <ScreenHeader title="بسته‌ی سوال" subtitle="هر وقت لازم داشتی، سوال بخر" color="#ED6956" exact mascot={{ char: 'pi', mood: 'excited', size: 60 }} />
<div className="flex flex-col gap-4 px-4 py-5"> <div className="flex flex-col gap-4 px-4 py-5">
<div className="rounded-3xl border border-line bg-white p-4"> <div className="rounded-3xl border border-line bg-white p-4">