Skip to content

Commit

Permalink
fix: using the slots of HomeLayout component on the Layout component …
Browse files Browse the repository at this point in the history
…has no effect (#194)
  • Loading branch information
codersjj committed Aug 8, 2023
1 parent 486e2ae commit a2b49b8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/island/src/theme-default/layout/Layout/index.tsx
@@ -1,9 +1,10 @@
import React from 'react';
import { Nav } from '../../components/Nav';
import { HomeLayout } from '../HomeLayout';
import { DocLayout } from '../DocLayout';
import { usePageData, Content } from '@runtime';
import { Helmet } from 'react-helmet-async';
import { HomeLayout, NotFoundLayout } from '@theme';
import { NotFoundLayout } from '@theme';
import { APILayout } from '../APILayout';
import { DocLayoutProps } from '../DocLayout/index';
import { HomeLayoutProps } from '../HomeLayout/index';
Expand All @@ -23,6 +24,10 @@ export const Layout: React.FC<LayoutProps> = (props) => {
const {
top,
bottom,
beforeHero,
afterHero,
beforeFeatures,
afterFeatures,
beforeDocFooter,
beforeDoc,
afterDoc,
Expand All @@ -31,6 +36,12 @@ export const Layout: React.FC<LayoutProps> = (props) => {
beforeNavTitle,
afterNavTitle
} = props;
const homeProps: HomeLayoutProps = {
beforeHero,
afterHero,
beforeFeatures,
afterFeatures
};
const docProps: DocLayoutProps = {
beforeDocFooter,
beforeDoc,
Expand All @@ -53,7 +64,7 @@ export const Layout: React.FC<LayoutProps> = (props) => {
const getContentLayout = () => {
switch (pageType) {
case 'home':
return <HomeLayout />;
return <HomeLayout {...homeProps} />;
case 'doc':
return <DocLayout {...docProps} />;
case 'api':
Expand Down

1 comment on commit a2b49b8

@vercel
Copy link

@vercel vercel bot commented on a2b49b8 Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.