From 2aa06d29eabf19472db1148e035ffe7cfd9c81d7 Mon Sep 17 00:00:00 2001 From: Shai Reznik Date: Wed, 17 Apr 2024 19:26:56 +0300 Subject: [PATCH] docs: added "missing component" route --- .../showcase-test/showcase-test.tsx | 29 ------------------- apps/website/src/routes/docs/headless/menu.md | 1 + .../routes/docs/headless/missing/index.mdx | 10 +++++++ apps/website/src/routes/docs/styled/menu.md | 1 + .../src/routes/docs/styled/missing/index.mdx | 10 +++++++ apps/website/src/routes/layout-test.tsx | 9 ------ 6 files changed, 22 insertions(+), 38 deletions(-) delete mode 100644 apps/website/src/components/showcase-test/showcase-test.tsx create mode 100644 apps/website/src/routes/docs/headless/missing/index.mdx create mode 100644 apps/website/src/routes/docs/styled/missing/index.mdx delete mode 100644 apps/website/src/routes/layout-test.tsx diff --git a/apps/website/src/components/showcase-test/showcase-test.tsx b/apps/website/src/components/showcase-test/showcase-test.tsx deleted file mode 100644 index 1152f4667..000000000 --- a/apps/website/src/components/showcase-test/showcase-test.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Component, component$, useSignal, useTask$ } from '@builder.io/qwik'; -import { useLocation } from '@builder.io/qwik-city'; -import { isDev } from '@builder.io/qwik/build'; -import { metaGlobComponents } from '../showcase/component-imports'; - -export const ShowcaseTest = component$(() => { - const location = useLocation(); - - const prevFolder = location.url.pathname.split('/').slice(0, -2).join('/') + '/'; - - const componentPath = `/src/routes${prevFolder}examples/${location.params.example}.tsx`; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const MetaGlobComponentSig = useSignal>(); - - useTask$(async () => { - MetaGlobComponentSig.value = isDev - ? await metaGlobComponents[componentPath]() // We need to call `await metaGlobComponents[componentPath]()` in development as it is `eager:false` - : metaGlobComponents[componentPath]; // We need to directly access the `metaGlobComponents[componentPath]` expression in preview/production as it is `eager:true` - }); - - return ( - <> -
- {MetaGlobComponentSig.value && } -
- - ); -}); diff --git a/apps/website/src/routes/docs/headless/menu.md b/apps/website/src/routes/docs/headless/menu.md index 0b2a661f3..f8355c6d0 100644 --- a/apps/website/src/routes/docs/headless/menu.md +++ b/apps/website/src/routes/docs/headless/menu.md @@ -13,6 +13,7 @@ ## Components +- [Missing a component?](/docs/headless/missing) - [Accordion](/docs/headless/accordion) - [Carousel](/docs/headless/carousel) - [Collapsible](/docs/headless/collapsible) diff --git a/apps/website/src/routes/docs/headless/missing/index.mdx b/apps/website/src/routes/docs/headless/missing/index.mdx new file mode 100644 index 000000000..fd5f9ff95 --- /dev/null +++ b/apps/website/src/routes/docs/headless/missing/index.mdx @@ -0,0 +1,10 @@ + diff --git a/apps/website/src/routes/docs/styled/menu.md b/apps/website/src/routes/docs/styled/menu.md index ecc70df88..2c0606a3d 100644 --- a/apps/website/src/routes/docs/styled/menu.md +++ b/apps/website/src/routes/docs/styled/menu.md @@ -13,6 +13,7 @@ ## Components +- [Missing a component?](/docs/styled/missing) - [Accordion](/docs/styled/accordion) - [Alert](/docs/styled/alert) - [Avatar](/docs/styled/avatar) diff --git a/apps/website/src/routes/docs/styled/missing/index.mdx b/apps/website/src/routes/docs/styled/missing/index.mdx new file mode 100644 index 000000000..fd5f9ff95 --- /dev/null +++ b/apps/website/src/routes/docs/styled/missing/index.mdx @@ -0,0 +1,10 @@ + diff --git a/apps/website/src/routes/layout-test.tsx b/apps/website/src/routes/layout-test.tsx deleted file mode 100644 index 8138942b4..000000000 --- a/apps/website/src/routes/layout-test.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { component$, Slot } from '@builder.io/qwik'; - -export default component$(() => { - return ( - <> - - - ); -});