color fix
This commit is contained in:
parent
e7854ceb93
commit
2fce0e3192
|
|
@ -5,6 +5,11 @@ import { router, useFocusEffect } from "expo-router";
|
|||
import { moderateScale } from "react-native-size-matters";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
import {
|
||||
type PageTone,
|
||||
toneColors,
|
||||
usePageTone,
|
||||
} from "../../context/PageToneContext";
|
||||
|
||||
export interface ContentPageHeaderProps {
|
||||
title: string;
|
||||
|
|
@ -14,6 +19,8 @@ export interface ContentPageHeaderProps {
|
|||
onTitlePress?: () => void;
|
||||
titleAccessibilityLabel?: string;
|
||||
onBack?: () => void;
|
||||
tone?: PageTone;
|
||||
titleColor?: string;
|
||||
}
|
||||
|
||||
export function ContentPageHeader({
|
||||
|
|
@ -24,7 +31,15 @@ export function ContentPageHeader({
|
|||
onTitlePress,
|
||||
titleAccessibilityLabel,
|
||||
onBack,
|
||||
tone,
|
||||
titleColor,
|
||||
}: ContentPageHeaderProps) {
|
||||
const { tone: contextTone } = usePageTone();
|
||||
const effectiveTone = tone || contextTone;
|
||||
const resolvedTitleColor =
|
||||
titleColor ||
|
||||
(effectiveTone && toneColors[effectiveTone]?.title) ||
|
||||
Colors.textPrimary;
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
if (!onBack) return;
|
||||
|
|
@ -59,7 +74,7 @@ export function ContentPageHeader({
|
|||
|
||||
const titleContent = (
|
||||
<View style={styles.titleContent}>
|
||||
<Text numberOfLines={1} style={styles.title}>
|
||||
<Text numberOfLines={1} style={[styles.title, { color: resolvedTitleColor }]}>
|
||||
{title}
|
||||
</Text>
|
||||
{subtitle ? (
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
import React, {
|
||||
createContext,
|
||||
useContext,
|
||||
useState,
|
||||
useEffect,
|
||||
type PropsWithChildren,
|
||||
} from "react";
|
||||
import { Colors } from "@/theme";
|
||||
|
||||
export type PageTone = "purple" | "blue" | "green";
|
||||
|
||||
export interface ToneColorScheme {
|
||||
accent: string;
|
||||
soft: string;
|
||||
border: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export const toneColors: Record<PageTone, ToneColorScheme> = {
|
||||
purple: {
|
||||
accent: Colors.purple, // "#75649B"
|
||||
soft: Colors.purpleSoft, // "#F6F3FA"
|
||||
border: "#E8E2F2",
|
||||
title: Colors.purple, // "#75649B"
|
||||
},
|
||||
blue: {
|
||||
accent: Colors.blue, // "#4E7496"
|
||||
soft: Colors.blueSoft, // "#F1F6FA"
|
||||
border: "#DAE6F0",
|
||||
title: Colors.blue, // "#4E7496"
|
||||
},
|
||||
green: {
|
||||
accent: Colors.primary, // "#2E7D32"
|
||||
soft: "#F2F8F4",
|
||||
border: "#DCEADF",
|
||||
title: Colors.primary, // "#2E7D32"
|
||||
},
|
||||
};
|
||||
|
||||
export interface PageToneContextType {
|
||||
tone: PageTone;
|
||||
setTone: (tone: PageTone) => void;
|
||||
}
|
||||
|
||||
export const PageToneContext = createContext<PageToneContextType>({
|
||||
tone: "green",
|
||||
setTone: () => {},
|
||||
});
|
||||
|
||||
export function PageToneProvider({
|
||||
tone: initialTone = "green",
|
||||
children,
|
||||
}: PropsWithChildren<{ tone?: PageTone }>) {
|
||||
const [tone, setTone] = useState<PageTone>(initialTone);
|
||||
|
||||
useEffect(() => {
|
||||
setTone(initialTone);
|
||||
}, [initialTone]);
|
||||
|
||||
return (
|
||||
<PageToneContext.Provider value={{ tone, setTone }}>
|
||||
{children}
|
||||
</PageToneContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function usePageTone(): PageToneContextType {
|
||||
return useContext(PageToneContext);
|
||||
}
|
||||
|
|
@ -68,6 +68,7 @@ export function MeridianPointsDetailRenderer({
|
|||
<Hero
|
||||
title={rawTitle}
|
||||
subtitle={totalCount ? `${totalCount} ${countLabel}` : undefined}
|
||||
tone="blue"
|
||||
/>
|
||||
|
||||
<View style={styles.list}>
|
||||
|
|
@ -87,6 +88,7 @@ export function MeridianPointsDetailRenderer({
|
|||
<StandardIndexCard
|
||||
title={title}
|
||||
subtitle={subtitle}
|
||||
tone="blue"
|
||||
onPress={() =>
|
||||
router.push(buildContentReferenceRoute(ref) as never)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import React from "react";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
|
||||
export function BulletList({ items }: { items: string[] }) {
|
||||
if (!items.length) return null;
|
||||
return (
|
||||
|
|
@ -23,7 +25,7 @@ const styles = StyleSheet.create({
|
|||
height: 6,
|
||||
marginTop: 9,
|
||||
borderRadius: 3,
|
||||
backgroundColor: "#5B806D",
|
||||
backgroundColor: Colors.primary,
|
||||
},
|
||||
text: { flex: 1, fontSize: 16, lineHeight: 25, color: "#334155" },
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
import React from "react";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
|
||||
const chipTones = [
|
||||
{ bg: "#EEF7F1", border: "#D5E8DB", text: "#35664E" },
|
||||
{ bg: "#EFF5FA", border: "#D7E5F0", text: "#3C617E" },
|
||||
{ bg: "#FAF4EB", border: "#EEDFC9", text: "#805C31" },
|
||||
];
|
||||
const greenChipTone = { bg: "#EEF7F1", border: "#D5E8DB", text: "#35664E" };
|
||||
|
||||
export function ChipList({ items }: { items: string[] }) {
|
||||
if (!items.length) return null;
|
||||
return (
|
||||
<View style={styles.root}>
|
||||
{items.map((item, index) => {
|
||||
const tone = chipTones[index % chipTones.length];
|
||||
{items.map((item) => {
|
||||
return (
|
||||
<View key={item} style={[styles.chip, { backgroundColor: tone.bg, borderColor: tone.border }]}>
|
||||
<Text style={[styles.text, { color: tone.text }]}>{item}</Text>
|
||||
<View key={item} style={[styles.chip, { backgroundColor: greenChipTone.bg, borderColor: greenChipTone.border }]}>
|
||||
<Text style={[styles.text, { color: greenChipTone.text }]}>{item}</Text>
|
||||
</View>
|
||||
);
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { Ionicons } from "@expo/vector-icons";
|
|||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
import { type PageTone } from "../../context/PageToneContext";
|
||||
import { ContentPageHeader } from "../../components/layout/ContentPageHeader";
|
||||
import { useModuleDisplayName } from "../../hooks/use-module-display-name";
|
||||
|
||||
|
|
@ -12,9 +13,10 @@ interface DetailPageShellProps extends PropsWithChildren {
|
|||
title: string;
|
||||
subtitle?: string;
|
||||
onBack?: () => void;
|
||||
tone?: PageTone;
|
||||
}
|
||||
|
||||
export function DetailPageShell({ children, onBack }: DetailPageShellProps) {
|
||||
export function DetailPageShell({ children, onBack, tone }: DetailPageShellProps) {
|
||||
const [isFavorite, setIsFavorite] = useState(false);
|
||||
const { moduleCode } = useLocalSearchParams<{ moduleCode?: string }>();
|
||||
const currentModuleCode = typeof moduleCode === "string" ? moduleCode : "";
|
||||
|
|
@ -54,6 +56,7 @@ export function DetailPageShell({ children, onBack }: DetailPageShellProps) {
|
|||
<SafeAreaView style={styles.screen} edges={["top", "left", "right"]}>
|
||||
<ContentPageHeader
|
||||
title={moduleDisplay.name}
|
||||
tone={tone}
|
||||
onBack={onBack}
|
||||
onTitlePress={
|
||||
currentModuleCode
|
||||
|
|
|
|||
|
|
@ -3,24 +3,44 @@ import { StyleSheet, Text, View } from "react-native";
|
|||
import { moderateScale, verticalScale } from "react-native-size-matters";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
import {
|
||||
type PageTone,
|
||||
toneColors,
|
||||
usePageTone,
|
||||
} from "../../context/PageToneContext";
|
||||
|
||||
export function Hero({
|
||||
eyebrow,
|
||||
title,
|
||||
subtitle,
|
||||
meta,
|
||||
tone,
|
||||
}: {
|
||||
eyebrow?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
meta?: string;
|
||||
tone?: PageTone;
|
||||
}) {
|
||||
const { tone: contextTone } = usePageTone();
|
||||
const currentTone = tone || contextTone || "green";
|
||||
const colors = toneColors[currentTone] || toneColors.green;
|
||||
|
||||
return (
|
||||
<View style={styles.card}>
|
||||
<View style={styles.accent} />
|
||||
<View
|
||||
style={[
|
||||
styles.card,
|
||||
{ backgroundColor: colors.soft, borderColor: colors.border },
|
||||
]}
|
||||
>
|
||||
<View style={[styles.accent, { backgroundColor: colors.accent }]} />
|
||||
<View style={styles.content}>
|
||||
{eyebrow ? <Text style={styles.eyebrow}>{eyebrow}</Text> : null}
|
||||
<Text style={styles.title}>{title}</Text>
|
||||
{eyebrow ? (
|
||||
<Text style={[styles.eyebrow, { color: colors.accent }]}>
|
||||
{eyebrow}
|
||||
</Text>
|
||||
) : null}
|
||||
<Text style={[styles.title, { color: colors.title }]}>{title}</Text>
|
||||
{subtitle ? <Text style={styles.subtitle}>{subtitle}</Text> : null}
|
||||
{meta ? <Text style={styles.meta}>{meta}</Text> : null}
|
||||
</View>
|
||||
|
|
|
|||
|
|
@ -1,44 +1,42 @@
|
|||
import React, { useMemo } from "react";
|
||||
import React from "react";
|
||||
import { Pressable, StyleSheet, Text, View } from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { moderateScale, verticalScale } from "react-native-size-matters";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
import {
|
||||
type PageTone,
|
||||
toneColors,
|
||||
usePageTone,
|
||||
} from "../../context/PageToneContext";
|
||||
|
||||
export type StandardIndexCardTone = PageTone;
|
||||
|
||||
export const cardTones = toneColors;
|
||||
|
||||
export interface StandardIndexCardProps {
|
||||
title: string;
|
||||
subtitle?: string | null;
|
||||
count?: number | null;
|
||||
countLabel?: string | null;
|
||||
tone?: StandardIndexCardTone;
|
||||
onPress: () => void;
|
||||
}
|
||||
|
||||
const tones = [
|
||||
{ soft: "#F0F7F3", accent: "#3F7D62" },
|
||||
{ soft: "#F1F6FA", accent: "#4E7496" },
|
||||
{ soft: "#FBF6EE", accent: "#A06E35" },
|
||||
{ soft: "#F6F3FA", accent: "#75649B" },
|
||||
];
|
||||
|
||||
function toneFor(value: string) {
|
||||
let hash = 0;
|
||||
for (let i = 0; i < value.length; i += 1) {
|
||||
hash = (hash * 31 + value.charCodeAt(i)) >>> 0;
|
||||
}
|
||||
return tones[hash % tones.length];
|
||||
}
|
||||
|
||||
/** Canonical soothing index row for CT0002 / CT0004 / CT0006 / CT0008. */
|
||||
export function StandardIndexCard({
|
||||
title,
|
||||
subtitle,
|
||||
count,
|
||||
countLabel,
|
||||
tone,
|
||||
onPress,
|
||||
}: StandardIndexCardProps) {
|
||||
const { tone: contextTone } = usePageTone();
|
||||
const normalizedTitle = title.trim();
|
||||
const normalizedSubtitle = subtitle?.trim() || null;
|
||||
const tone = useMemo(() => toneFor(normalizedTitle), [normalizedTitle]);
|
||||
const effectiveTone = tone || contextTone || "purple";
|
||||
const currentTone = cardTones[effectiveTone] || cardTones.purple;
|
||||
|
||||
return (
|
||||
<Pressable
|
||||
|
|
@ -47,8 +45,8 @@ export function StandardIndexCard({
|
|||
onPress={onPress}
|
||||
style={({ pressed }) => [styles.row, pressed && styles.pressed]}
|
||||
>
|
||||
<View style={[styles.accent, { backgroundColor: tone.soft }]}>
|
||||
<View style={[styles.accentDot, { backgroundColor: tone.accent }]} />
|
||||
<View style={[styles.accent, { backgroundColor: currentTone.soft }]}>
|
||||
<View style={[styles.accentDot, { backgroundColor: currentTone.accent }]} />
|
||||
</View>
|
||||
|
||||
<View style={styles.titleBlock}>
|
||||
|
|
@ -63,8 +61,8 @@ export function StandardIndexCard({
|
|||
</View>
|
||||
|
||||
{count !== null && count !== undefined ? (
|
||||
<View style={[styles.countBadge, { backgroundColor: tone.soft }]}>
|
||||
<Text style={[styles.countText, { color: tone.accent }]}>{count}</Text>
|
||||
<View style={[styles.countBadge, { backgroundColor: currentTone.soft }]}>
|
||||
<Text style={[styles.countText, { color: currentTone.accent }]}>{count}</Text>
|
||||
{countLabel ? (
|
||||
<Text numberOfLines={1} style={styles.countLabel}>
|
||||
{countLabel}
|
||||
|
|
|
|||
|
|
@ -5,24 +5,13 @@ export interface ReadingTone {
|
|||
title: string;
|
||||
}
|
||||
|
||||
const tones: readonly ReadingTone[] = [
|
||||
{ accent: "#3F7D62", soft: "#F0F7F3", border: "#D7E9DE", title: "#285A44" },
|
||||
{ accent: "#4E7496", soft: "#F1F6FA", border: "#D9E6F0", title: "#365B78" },
|
||||
{ accent: "#A06E35", soft: "#FBF6EE", border: "#EEE0CC", title: "#7E5529" },
|
||||
{ accent: "#75649B", soft: "#F6F3FA", border: "#E4DDF0", title: "#594978" },
|
||||
{ accent: "#A15D63", soft: "#FBF3F4", border: "#EEDBDE", title: "#7C4248" },
|
||||
];
|
||||
export const greenTone: ReadingTone = {
|
||||
accent: "#3F7D62",
|
||||
soft: "#F0F7F3",
|
||||
border: "#D7E9DE",
|
||||
title: "#285A44",
|
||||
};
|
||||
|
||||
export function readingToneForTitle(title: string): ReadingTone {
|
||||
const normalized = title.trim().toLowerCase();
|
||||
|
||||
if (normalized.includes("caution") || normalized.includes("warning")) {
|
||||
return { accent: "#B45353", soft: "#FFF5F5", border: "#F2D7D7", title: "#8D3F3F" };
|
||||
}
|
||||
|
||||
let hash = 0;
|
||||
for (let index = 0; index < normalized.length; index += 1) {
|
||||
hash = (hash * 31 + normalized.charCodeAt(index)) >>> 0;
|
||||
}
|
||||
return tones[hash % tones.length];
|
||||
export function readingToneForTitle(_title?: string): ReadingTone {
|
||||
return greenTone;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { Ionicons } from "@expo/vector-icons";
|
|||
import { router } from "expo-router";
|
||||
|
||||
import { Colors } from "@/theme";
|
||||
import { PageToneProvider } from "../context/PageToneContext";
|
||||
import { ContentPageHeader } from "../components/layout/ContentPageHeader";
|
||||
import { ScreenError } from "../components/ContentScreenState";
|
||||
import { ContractSortModal } from "../components/search/ContractSortModal";
|
||||
|
|
@ -131,19 +132,48 @@ export function CollectionTemplateScreen({
|
|||
);
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.screen} edges={["top", "left", "right"]}>
|
||||
<ContentPageHeader
|
||||
title={moduleDisplay.name}
|
||||
onTitlePress={() => router.push(moduleDisplay.homeRoute as never)}
|
||||
titleAccessibilityLabel={`Open ${moduleDisplay.name} home`}
|
||||
right={headerActions}
|
||||
/>
|
||||
<PageToneProvider tone="purple">
|
||||
<SafeAreaView style={styles.screen} edges={["top", "left", "right"]}>
|
||||
<ContentPageHeader
|
||||
title={moduleDisplay.name}
|
||||
onTitlePress={() => router.push(moduleDisplay.homeRoute as never)}
|
||||
titleAccessibilityLabel={`Open ${moduleDisplay.name} home`}
|
||||
right={headerActions}
|
||||
/>
|
||||
|
||||
<RendererFallbackBoundary
|
||||
rendererKind="collection"
|
||||
rendererCode={collectionRendererCode}
|
||||
fallback={
|
||||
<GenericCollectionRenderer
|
||||
<RendererFallbackBoundary
|
||||
rendererKind="collection"
|
||||
rendererCode={collectionRendererCode}
|
||||
fallback={
|
||||
<GenericCollectionRenderer
|
||||
items={merged.items}
|
||||
total={merged.total}
|
||||
isLoading={query.isLoading}
|
||||
isRefreshing={query.isRefetching && !query.isFetchingNextPage}
|
||||
isFetchingNextPage={query.isFetchingNextPage}
|
||||
onRefresh={() => void query.refetch()}
|
||||
onLoadMore={() => {
|
||||
if (query.hasNextPage && !query.isFetchingNextPage) {
|
||||
void query.fetchNextPage();
|
||||
}
|
||||
}}
|
||||
onItemPress={(item) => {
|
||||
const references = Object.values(item.attributes).flatMap((value) =>
|
||||
getNavigableContentReferences(value),
|
||||
);
|
||||
if (references.length === 1) {
|
||||
router.push(buildContentReferenceRoute(references[0]) as never);
|
||||
return;
|
||||
}
|
||||
onContentPress(item.id);
|
||||
}}
|
||||
renderItem={({ item, onPress }) => (
|
||||
<GenericCardRenderer item={item} onPress={onPress} />
|
||||
)}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<CollectionRenderer
|
||||
items={merged.items}
|
||||
total={merged.total}
|
||||
isLoading={query.isLoading}
|
||||
|
|
@ -166,56 +196,29 @@ export function CollectionTemplateScreen({
|
|||
onContentPress(item.id);
|
||||
}}
|
||||
renderItem={({ item, onPress }) => (
|
||||
<GenericCardRenderer item={item} onPress={onPress} />
|
||||
<RendererFallbackBoundary
|
||||
rendererKind="collection_item"
|
||||
rendererCode={itemRendererCode}
|
||||
fallback={<GenericCardRenderer item={item} onPress={onPress} />}
|
||||
>
|
||||
<ItemRenderer item={item} onPress={onPress} />
|
||||
</RendererFallbackBoundary>
|
||||
)}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<CollectionRenderer
|
||||
items={merged.items}
|
||||
total={merged.total}
|
||||
isLoading={query.isLoading}
|
||||
isRefreshing={query.isRefetching && !query.isFetchingNextPage}
|
||||
isFetchingNextPage={query.isFetchingNextPage}
|
||||
onRefresh={() => void query.refetch()}
|
||||
onLoadMore={() => {
|
||||
if (query.hasNextPage && !query.isFetchingNextPage) {
|
||||
void query.fetchNextPage();
|
||||
}
|
||||
}}
|
||||
onItemPress={(item) => {
|
||||
const references = Object.values(item.attributes).flatMap((value) =>
|
||||
getNavigableContentReferences(value),
|
||||
);
|
||||
if (references.length === 1) {
|
||||
router.push(buildContentReferenceRoute(references[0]) as never);
|
||||
return;
|
||||
}
|
||||
onContentPress(item.id);
|
||||
}}
|
||||
renderItem={({ item, onPress }) => (
|
||||
<RendererFallbackBoundary
|
||||
rendererKind="collection_item"
|
||||
rendererCode={itemRendererCode}
|
||||
fallback={<GenericCardRenderer item={item} onPress={onPress} />}
|
||||
>
|
||||
<ItemRenderer item={item} onPress={onPress} />
|
||||
</RendererFallbackBoundary>
|
||||
)}
|
||||
/>
|
||||
</RendererFallbackBoundary>
|
||||
</RendererFallbackBoundary>
|
||||
|
||||
{hasSort ? (
|
||||
<ContractSortModal
|
||||
visible={sortVisible}
|
||||
fields={contract.search.sort_fields}
|
||||
sort={search.sort}
|
||||
defaultSort={contract.search.default_sort}
|
||||
onApply={search.setSort}
|
||||
onClose={() => setSortVisible(false)}
|
||||
/>
|
||||
) : null}
|
||||
</SafeAreaView>
|
||||
{hasSort ? (
|
||||
<ContractSortModal
|
||||
visible={sortVisible}
|
||||
fields={contract.search.sort_fields}
|
||||
sort={search.sort}
|
||||
defaultSort={contract.search.default_sort}
|
||||
onApply={search.setSort}
|
||||
onClose={() => setSortVisible(false)}
|
||||
/>
|
||||
) : null}
|
||||
</SafeAreaView>
|
||||
</PageToneProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { RendererFallbackBoundary } from "../renderers/shared/RendererFallbackBo
|
|||
import { DetailPageShell } from "../renderers/shared/DetailPageShell";
|
||||
import { applyPresentationContractToData } from "../utils/attribute-presentation";
|
||||
import { BackActionContext } from "../context/BackActionContext";
|
||||
import { PageToneProvider, type PageTone } from "../context/PageToneContext";
|
||||
|
||||
export interface ContentDetailScreenProps {
|
||||
moduleCode: string;
|
||||
|
|
@ -105,19 +106,43 @@ function ContentDetailScreenResolved({
|
|||
.map((value) => value.trim())
|
||||
.join(" · ");
|
||||
|
||||
const isIntermediateList =
|
||||
rendererCode === "meridian_points_detail" ||
|
||||
rendererCode === "meridian_index_detail" ||
|
||||
templateCode === "m0001_ct0002";
|
||||
const pageTone: PageTone = isIntermediateList ? "blue" : "green";
|
||||
|
||||
return (
|
||||
<DetailPageShell
|
||||
title={displayTitle}
|
||||
subtitle={alternateNames || undefined}
|
||||
onBack={customBack ?? undefined}
|
||||
>
|
||||
<BackActionContext.Provider value={{ setCustomBackAction: setCustomBack }}>
|
||||
<ContentMediaProvider media={response.media}>
|
||||
<RendererFallbackBoundary
|
||||
rendererKind="detail"
|
||||
rendererCode={rendererCode}
|
||||
fallback={
|
||||
<GenericDetailRenderer
|
||||
<PageToneProvider tone={pageTone}>
|
||||
<DetailPageShell
|
||||
title={displayTitle}
|
||||
subtitle={alternateNames || undefined}
|
||||
onBack={customBack ?? undefined}
|
||||
tone={pageTone}
|
||||
>
|
||||
<BackActionContext.Provider value={{ setCustomBackAction: setCustomBack }}>
|
||||
<ContentMediaProvider media={response.media}>
|
||||
<RendererFallbackBoundary
|
||||
rendererKind="detail"
|
||||
rendererCode={rendererCode}
|
||||
fallback={
|
||||
<GenericDetailRenderer
|
||||
moduleCode={moduleCode}
|
||||
templateCode={templateCode}
|
||||
contentId={response.content.id}
|
||||
content={{
|
||||
id: response.content.id,
|
||||
title: response.content.title,
|
||||
slug: response.content.slug,
|
||||
summary: response.content.summary,
|
||||
}}
|
||||
data={presentedData}
|
||||
definitions={screen.definitionsQuery.data?.attributes ?? []}
|
||||
presentationAttributes={presentationAttributes}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Renderer
|
||||
moduleCode={moduleCode}
|
||||
templateCode={templateCode}
|
||||
contentId={response.content.id}
|
||||
|
|
@ -131,25 +156,10 @@ function ContentDetailScreenResolved({
|
|||
definitions={screen.definitionsQuery.data?.attributes ?? []}
|
||||
presentationAttributes={presentationAttributes}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Renderer
|
||||
moduleCode={moduleCode}
|
||||
templateCode={templateCode}
|
||||
contentId={response.content.id}
|
||||
content={{
|
||||
id: response.content.id,
|
||||
title: response.content.title,
|
||||
slug: response.content.slug,
|
||||
summary: response.content.summary,
|
||||
}}
|
||||
data={presentedData}
|
||||
definitions={screen.definitionsQuery.data?.attributes ?? []}
|
||||
presentationAttributes={presentationAttributes}
|
||||
/>
|
||||
</RendererFallbackBoundary>
|
||||
</ContentMediaProvider>
|
||||
</BackActionContext.Provider>
|
||||
</DetailPageShell>
|
||||
</RendererFallbackBoundary>
|
||||
</ContentMediaProvider>
|
||||
</BackActionContext.Provider>
|
||||
</DetailPageShell>
|
||||
</PageToneProvider>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ const styles = StyleSheet.create({
|
|||
headerTitle: {
|
||||
fontSize: moderateScale(18),
|
||||
fontWeight: "700",
|
||||
color: Colors.textPrimary,
|
||||
color: Colors.primary,
|
||||
},
|
||||
headerActions: {
|
||||
flexDirection: "row",
|
||||
|
|
|
|||
|
|
@ -5,6 +5,14 @@ export const Colors = {
|
|||
|
||||
secondary: "#1565C0",
|
||||
|
||||
purple: "#75649B",
|
||||
purpleSoft: "#F6F3FA",
|
||||
|
||||
blue: "#4E7496",
|
||||
blueSoft: "#F1F6FA",
|
||||
|
||||
greenSoft: "#E8F5E9",
|
||||
|
||||
background: "#FFFFFF",
|
||||
surface: "#F8F9FA",
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue