From ea1dd5cf1d8c4e2b1f8b41582830f0b8ff5f3add Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Sat, 26 Sep 2026 21:05:56 +0200 Subject: [PATCH] refactor(app): drop the unused actions slot from PageLayout --- .../app/src/components/page-layout/index.tsx | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/packages/app/src/components/page-layout/index.tsx b/packages/app/src/components/page-layout/index.tsx index edecda1ff8..d2b22221cd 100644 --- a/packages/app/src/components/page-layout/index.tsx +++ b/packages/app/src/components/page-layout/index.tsx @@ -8,8 +8,6 @@ import { useIsCompactFormFactor } from "@/constants/layout"; interface PageLayoutProps { title?: string; - /** Sits at the end of the title row on desktop and in the header on compact. */ - actions?: ReactNode; /** Compact back button. Defaults to navigating back. */ onBack?: () => void; testID?: string; @@ -21,28 +19,21 @@ interface PageLayoutProps { * document heading inside the page and the header only keeps the titlebar drag * region and window controls; on compact the title moves into a back header. */ -export function PageLayout({ title, actions, onBack, testID, children }: PageLayoutProps) { +export function PageLayout({ title, onBack, testID, children }: PageLayoutProps) { const isCompact = useIsCompactFormFactor(); const insets = useSafeAreaInsets(); const scrollContentStyle = useMemo(() => ({ paddingBottom: insets.bottom }), [insets.bottom]); - const showTitleRow = !isCompact && (title !== undefined || actions !== undefined); + const showTitle = !isCompact && title !== undefined; return ( - {isCompact ? ( - - ) : ( - - )} + {isCompact ? : } - {showTitleRow ? ( - - - {title} - - {actions} - + {showTitle ? ( + + {title} + ) : null} {children} @@ -66,16 +57,10 @@ const styles = StyleSheet.create((theme) => ({ maxWidth: 720, alignSelf: "center", }, - titleRow: { - flexDirection: "row", - alignItems: "center", - gap: theme.spacing[2], + title: { // Line up with the section titles, which sit inset from their cards. marginLeft: theme.spacing[1], marginBottom: theme.spacing[6], - }, - title: { - flex: 1, fontSize: theme.fontSize["4xl"], fontWeight: theme.fontWeight.medium, color: theme.colors.foreground,