MCPcopy Create free account
hub / github.com/dailydotdev/apps / ShellPage

Function ShellPage

packages/shared/src/components/shell/ShellPageContext.tsx:114–136  ·  view source on GitHub ↗
({
  title,
  titleFades,
  actions,
  row,
  transparent,
  hidden,
  onBack,
}: ShellPageConfig)

Source from the content-addressed store, hash-verified

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.
114export 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};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected