default.js 937 B

12345678910111213141516171819202122
  1. import { View } from 'app/design/view';
  2. import { appStatic } from 'app/lib/app-static';
  3. import Page from 'app/ui/molecules/page/page';
  4. export default function PageLayout({ children, data, pageClasses }) {
  5. const { width, contentWidth, padding, gap } = pageClasses ?? {};
  6. return (
  7. <Page data={data}>
  8. {/* Page override slot: the static component `components_<uri>` renders above the
  9. UNA blocks when the registry has one (see appStatic). UNA shows nothing about it,
  10. and only layouts mapped to this component get it (page-layout/_map.js). */}
  11. {data?.uri ? appStatic('components_' + data?.uri, data) : null}
  12. <View className={width}>
  13. <View className={`${contentWidth} ${padding} ${gap} mx-auto`}>
  14. {children}
  15. </View>
  16. </View>
  17. {appStatic('components_footer')}
  18. </Page>
  19. );
  20. }