Skip to content

Commit

Permalink
#10: HMDB (ex-gatsby) pages re-made in new setup
Browse files Browse the repository at this point in the history
  • Loading branch information
espen42 committed Sep 7, 2021
1 parent e73080b commit f753f4d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions next/src/components/templateSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import PersonPage from "./templates/Person";
const contentTypeSpecificTemplate = {
//'base:folder': FolderPage

//'base:folder': ListPage,
//[`${appKey}:person`]: PersonPage,
//[`${appKey}:movie`]: MoviePage
'base:folder': ListPage,
[`${appKey}:person`]: PersonPage,
[`${appKey}:movie`]: MoviePage
};

export const getTemplate = (contentType) => contentTypeSpecificTemplate[contentType] || DefaultPage;
6 changes: 3 additions & 3 deletions next/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import SEO from '../components/blocks/seo'
function MyApp({Component, pageProps}: AppProps) {
return (
<>
{/*<Layout siteTitle="Enonic ❤ Next.js">*/}
{/*<SEO title={pageProps.displayName} siteTitle="NextXP Poc"/>*/}
<Layout siteTitle="Enonic ❤ Next.js">
<SEO title={pageProps.displayName} siteTitle="NextXP Poc"/>
<Component {...pageProps} />
{/*</Layout>*/}
</Layout>
</>
);
}
Expand Down
1 change: 1 addition & 0 deletions next/src/shared/data/queries/getFolder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ export type ChildContent = {
export type Folder = {
displayName: string,
children: ChildContent[],
type: string
};
6 changes: 3 additions & 3 deletions next/src/shared/data/querySelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import PERSON_QUERY from './queries/getPerson';
const contentTypeSpecificQueries = {
//'base:folder': FOLDER_QUERY,

//'base:folder': LIST_QUERY,
//[`${appKey}:movie`]: MOVIE_QUERY,
//[`${appKey}:person`]: PERSON_QUERY,
'base:folder': LIST_QUERY,
[`${appKey}:movie`]: MOVIE_QUERY,
[`${appKey}:person`]: PERSON_QUERY,

// 'my.example.app:content-type': '{ guillotine { get { custom query string etc } } }'
};
Expand Down

0 comments on commit f753f4d

Please sign in to comment.