({
title,
titleFades,
actions,
row,
transparent,
hidden,
onBack,
}: ShellPageConfig)
| 112 | // A leaf declares what its top block shows by rendering this anywhere in |
| 113 | // its tree; the block in MainLayout picks it up. Unmounting clears it. |
| 114 | export const ShellPage = ({ |
| 115 | title, |
| 116 | titleFades, |
| 117 | actions, |
| 118 | row, |
| 119 | transparent, |
| 120 | hidden, |
| 121 | onBack, |
| 122 | }: ShellPageConfig): ReactElement | null => { |
| 123 | const { setConfig, actionsSlot } = useContext(ShellPageContext); |
| 124 | |
| 125 | useLayoutEffect(() => { |
| 126 | setConfig({ title, titleFades, row, transparent, hidden, onBack }); |
| 127 | }, [setConfig, title, titleFades, row, transparent, hidden, onBack]); |
| 128 | |
| 129 | useLayoutEffect(() => () => setConfig(null), [setConfig]); |
| 130 | |
| 131 | if (!actions || !actionsSlot) { |
| 132 | return null; |
| 133 | } |
| 134 | |
| 135 | return createPortal(actions, actionsSlot); |
| 136 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected