From ff7cf3208cce81ebb417bac3d332f34676d017d0 Mon Sep 17 00:00:00 2001 From: Pedro Nauck Date: Thu, 19 Jul 2018 02:32:08 -0300 Subject: [PATCH] fix(docz): default DocPreview components --- packages/docz/src/components/DocPreview.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/docz/src/components/DocPreview.tsx b/packages/docz/src/components/DocPreview.tsx index 5d62e68f8..f3cc726c8 100644 --- a/packages/docz/src/components/DocPreview.tsx +++ b/packages/docz/src/components/DocPreview.tsx @@ -10,8 +10,8 @@ export type PageProps = RouteComponentProps & { doc: Entry } -const Identity: SFC = ({ children }) => children -const DefaultLoading: SFC = () => null +const Identity: SFC = ({ children }) => {children} +const DefaultLoading: SFC = () => Loading export type RenderComponent = ComponentType<{ component: JSX.Element @@ -27,6 +27,9 @@ export const DefaultRender: RenderComponent = ({ component, code }) => ( ) +export type NotFoundComponent = ComponentType> +const DefaultNotFound: NotFoundComponent = () => Not found + export interface ComponentsMap { loading?: ComponentType page?: ComponentType @@ -58,8 +61,8 @@ const loadImport = (imports: ImportMap, components: ComponentsMap) => ( const defaultComponents: ComponentsMap = { loading: DefaultLoading, render: DefaultRender, + notFound: DefaultNotFound, page: Identity, - notFound: Identity, } export interface DocPreviewProps {