diff --git a/docs/.gitignore b/docs/.gitignore deleted file mode 100644 index 6357dc96e9..0000000000 --- a/docs/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.next -.now -.env -.env.* -node_modules -*.log -.DS_Store -.vercel \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 6256982818..0000000000 --- a/docs/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# React Query Docs - -This is source code to react-query.tanstack.com. It is forked from the [Formik](https://formik.org) docs and is built with: - -- Next.js -- MDX -- Tailwind -- Algolia -- Notion - -## Running locally - -```sh -yarn install -``` - -At the moment, you need to signup for Notion, and [follow these instructions](https://github.com/ijjk/notion-blog#getting-blog-index-and-token) to get a token and create a blog in order to develop locally. Not ideal, but hopefully will fix soon. - -With tokens and page index in hand, rename `.sample.env` and `.sample.env.build` to just `.env` and `.env.build`. In each one, add respective parameters: - -```diff --NOTION_TOKEN=XXXX -+NOTION_TOKEN= --BLOG_INDEX_ID=XXXXX -+BLOG_INDEX_ID= -``` - -Now it will work. Run `yarn dev` to get going. - -If you get stuck or need help, [send a DM to Jared](https://twitter.com/jaredpalmer) on Twitter. diff --git a/docs/config.json b/docs/config.json index 40cc191ee0..6c5dfbd47e 100644 --- a/docs/config.json +++ b/docs/config.json @@ -1,4 +1,5 @@ { + "$schema": "https://raw.githubusercontent.com/TanStack/tanstack.com/main/tanstack-docs-config.schema.json", "docSearch": { "appId": "ZFKQRGRQA8", "apiKey": "93e0b83eb0b5af4549b6bf47f90af3f7", @@ -14,39 +15,39 @@ "children": [ { "label": "Overview", - "to": "react/overview" + "to": "framework/react/overview" }, { "label": "Installation", - "to": "react/installation" + "to": "framework/react/installation" }, { "label": "Quick Start", - "to": "react/quick-start" + "to": "framework/react/quick-start" }, { "label": "Devtools", - "to": "react/devtools" + "to": "framework/react/devtools" }, { "label": "Videos & Talks", - "to": "react/videos" + "to": "framework/react/videos" }, { "label": "Comparison", - "to": "react/comparison" + "to": "framework/react/comparison" }, { "label": "TypeScript", - "to": "react/typescript" + "to": "framework/react/typescript" }, { "label": "GraphQL", - "to": "react/graphql" + "to": "framework/react/graphql" }, { "label": "React Native", - "to": "react/react-native" + "to": "framework/react/react-native" } ] }, @@ -55,123 +56,123 @@ "children": [ { "label": "Important Defaults", - "to": "react/guides/important-defaults" + "to": "framework/react/guides/important-defaults" }, { "label": "Queries", - "to": "react/guides/queries" + "to": "framework/react/guides/queries" }, { "label": "Query Keys", - "to": "react/guides/query-keys" + "to": "framework/react/guides/query-keys" }, { "label": "Query Functions", - "to": "react/guides/query-functions" + "to": "framework/react/guides/query-functions" }, { "label": "Parallel Queries", - "to": "react/guides/parallel-queries" + "to": "framework/react/guides/parallel-queries" }, { "label": "Dependent Queries", - "to": "react/guides/dependent-queries" + "to": "framework/react/guides/dependent-queries" }, { "label": "Background Fetching Indicators", - "to": "react/guides/background-fetching-indicators" + "to": "framework/react/guides/background-fetching-indicators" }, { "label": "Window Focus Refetching", - "to": "react/guides/window-focus-refetching" + "to": "framework/react/guides/window-focus-refetching" }, { "label": "Disabling/Pausing Queries", - "to": "react/guides/disabling-queries" + "to": "framework/react/guides/disabling-queries" }, { "label": "Query Retries", - "to": "react/guides/query-retries" + "to": "framework/react/guides/query-retries" }, { "label": "Paginated Queries", - "to": "react/guides/paginated-queries" + "to": "framework/react/guides/paginated-queries" }, { "label": "Infinite Queries", - "to": "react/guides/infinite-queries" + "to": "framework/react/guides/infinite-queries" }, { "label": "Initial Query Data", - "to": "react/guides/initial-query-data" + "to": "framework/react/guides/initial-query-data" }, { "label": "Placeholder Query Data", - "to": "react/guides/placeholder-query-data" + "to": "framework/react/guides/placeholder-query-data" }, { "label": "Prefetching", - "to": "react/guides/prefetching" + "to": "framework/react/guides/prefetching" }, { "label": "Mutations", - "to": "react/guides/mutations" + "to": "framework/react/guides/mutations" }, { "label": "Query Invalidation", - "to": "react/guides/query-invalidation" + "to": "framework/react/guides/query-invalidation" }, { "label": "Invalidation from Mutations", - "to": "react/guides/invalidations-from-mutations" + "to": "framework/react/guides/invalidations-from-mutations" }, { "label": "Updates from Mutation Responses", - "to": "react/guides/updates-from-mutation-responses" + "to": "framework/react/guides/updates-from-mutation-responses" }, { "label": "Optimistic Updates", - "to": "react/guides/optimistic-updates" + "to": "framework/react/guides/optimistic-updates" }, { "label": "Query Cancellation", - "to": "react/guides/query-cancellation" + "to": "framework/react/guides/query-cancellation" }, { "label": "Scroll Restoration", - "to": "react/guides/scroll-restoration" + "to": "framework/react/guides/scroll-restoration" }, { "label": "Filters", - "to": "react/guides/filters" + "to": "framework/react/guides/filters" }, { "label": "SSR & Next.js", - "to": "react/guides/ssr" + "to": "framework/react/guides/ssr" }, { "label": "Caching", - "to": "react/guides/caching" + "to": "framework/react/guides/caching" }, { "label": "Default Query Fn", - "to": "react/guides/default-query-function" + "to": "framework/react/guides/default-query-function" }, { "label": "Suspense", - "to": "react/guides/suspense" + "to": "framework/react/guides/suspense" }, { "label": "Testing", - "to": "react/guides/testing" + "to": "framework/react/guides/testing" }, { "label": "Does this replace [Redux, MobX, etc]?", - "to": "react/guides/does-this-replace-client-state" + "to": "framework/react/guides/does-this-replace-client-state" }, { "label": "Migrating to React Query 3", - "to": "react/guides/migrating-to-react-query-3" + "to": "framework/react/guides/migrating-to-react-query-3" } ] }, @@ -180,7 +181,7 @@ "children": [ { "label": "TkDodo's Blog", - "to": "react/community/tkdodos-blog" + "to": "framework/react/community/tkdodos-blog" } ] }, @@ -189,71 +190,71 @@ "children": [ { "label": "Simple", - "to": "react/examples/react/simple" + "to": "framework/react/examples/simple" }, { "label": "Basic", - "to": "react/examples/react/basic" + "to": "framework/react/examples/basic" }, { "label": "Basic w/ GraphQL-Request", - "to": "react/examples/react/basic-graphql-request" + "to": "framework/react/examples/basic-graphql-request" }, { "label": "Auto Refetching / Polling / Realtime", - "to": "react/examples/react/auto-refetching" + "to": "framework/react/examples/auto-refetching" }, { "label": "Optimistic Updates in TypeScript", - "to": "react/examples/react/optimistic-updates-typescript" + "to": "framework/react/examples/optimistic-updates-typescript" }, { "label": "Pagination", - "to": "react/examples/react/pagination" + "to": "framework/react/examples/pagination" }, { "label": "Load-More & Infinite Scroll", - "to": "react/examples/react/load-more-infinite-scroll" + "to": "framework/react/examples/load-more-infinite-scroll" }, { "label": "Suspense", - "to": "react/examples/react/suspense" + "to": "framework/react/examples/suspense" }, { "label": "Default Query Function", - "to": "react/examples/react/default-query-function" + "to": "framework/react/examples/default-query-function" }, { "label": "Playground", - "to": "react/examples/react/playground" + "to": "framework/react/examples/playground" }, { "label": "Prefetching", - "to": "react/examples/react/prefetching" + "to": "framework/react/examples/prefetching" }, { "label": "Star Wars", - "to": "react/examples/react/star-wars" + "to": "framework/react/examples/star-wars" }, { "label": "Rick And Morty", - "to": "react/examples/react/rick-morty" + "to": "framework/react/examples/rick-morty" }, { "label": "Next.js", - "to": "react/examples/react/nextjs" + "to": "framework/react/examples/nextjs" }, { "label": "React Native", - "to": "react/examples/react/react-native" + "to": "framework/react/examples/react-native" }, { "label": "React Router", - "to": "react/examples/react/react-router" + "to": "framework/react/examples/react-router" }, { "label": "Offline Queries and Mutations", - "to": "react/examples/react/offline" + "to": "framework/react/examples/offline" } ] }, @@ -262,19 +263,19 @@ "children": [ { "label": "persistQueryClient (Experimental)", - "to": "react/plugins/persistQueryClient" + "to": "framework/react/plugins/persistQueryClient" }, { "label": "createWebStoragePersistor (Experimental)", - "to": "react/plugins/createWebStoragePersistor" + "to": "framework/react/plugins/createWebStoragePersistor" }, { "label": "createAsyncStoragePersistor (Experimental)", - "to": "react/plugins/createAsyncStoragePersistor" + "to": "framework/react/plugins/createAsyncStoragePersistor" }, { "label": "broadcastQueryClient (Experimental)", - "to": "react/plugins/broadcastQueryClient" + "to": "framework/react/plugins/broadcastQueryClient" } ] }, @@ -283,83 +284,83 @@ "children": [ { "label": "useQuery", - "to": "react/reference/useQuery" + "to": "framework/react/reference/useQuery" }, { "label": "useQueries", - "to": "react/reference/useQueries" + "to": "framework/react/reference/useQueries" }, { "label": "useInfiniteQuery", - "to": "react/reference/useInfiniteQuery" + "to": "framework/react/reference/useInfiniteQuery" }, { "label": "useMutation", - "to": "react/reference/useMutation" + "to": "framework/react/reference/useMutation" }, { "label": "useIsFetching", - "to": "react/reference/useIsFetching" + "to": "framework/react/reference/useIsFetching" }, { "label": "useIsMutating", - "to": "react/reference/useIsMutating" + "to": "framework/react/reference/useIsMutating" }, { "label": "QueryClient", - "to": "react/reference/QueryClient" + "to": "framework/react/reference/QueryClient" }, { "label": "QueryClientProvider", - "to": "react/reference/QueryClientProvider" + "to": "framework/react/reference/QueryClientProvider" }, { "label": "useQueryClient", - "to": "react/reference/useQueryClient" + "to": "framework/react/reference/useQueryClient" }, { "label": "QueryCache", - "to": "react/reference/QueryCache" + "to": "framework/react/reference/QueryCache" }, { "label": "MutationCache", - "to": "react/reference/MutationCache" + "to": "framework/react/reference/MutationCache" }, { "label": "QueryObserver", - "to": "react/reference/QueryObserver" + "to": "framework/react/reference/QueryObserver" }, { "label": "InfiniteQueryObserver", - "to": "react/reference/InfiniteQueryObserver" + "to": "framework/react/reference/InfiniteQueryObserver" }, { "label": "QueriesObserver", - "to": "react/reference/QueriesObserver" + "to": "framework/react/reference/QueriesObserver" }, { "label": "QueryErrorResetBoundary", - "to": "react/reference/QueryErrorResetBoundary" + "to": "framework/react/reference/QueryErrorResetBoundary" }, { "label": "useQueryErrorResetBoundary", - "to": "react/reference/useQueryErrorResetBoundary" + "to": "framework/react/reference/useQueryErrorResetBoundary" }, { "label": "focusManager", - "to": "react/reference/focusManager" + "to": "framework/react/reference/focusManager" }, { "label": "onlineManager", - "to": "react/reference/onlineManager" + "to": "framework/react/reference/onlineManager" }, { "label": "setLogger", - "to": "react/reference/setLogger" + "to": "framework/react/reference/setLogger" }, { "label": "hydration", - "to": "react/reference/hydration" + "to": "framework/react/reference/hydration" } ] } diff --git a/docs/react/community/tkdodos-blog.md b/docs/framework/react/community/tkdodos-blog.md similarity index 100% rename from docs/react/community/tkdodos-blog.md rename to docs/framework/react/community/tkdodos-blog.md diff --git a/docs/react/comparison.md b/docs/framework/react/comparison.md similarity index 100% rename from docs/react/comparison.md rename to docs/framework/react/comparison.md diff --git a/docs/react/devtools.md b/docs/framework/react/devtools.md similarity index 100% rename from docs/react/devtools.md rename to docs/framework/react/devtools.md diff --git a/docs/react/examples/auto-refetching.mdx b/docs/framework/react/examples/auto-refetching.mdx similarity index 100% rename from docs/react/examples/auto-refetching.mdx rename to docs/framework/react/examples/auto-refetching.mdx diff --git a/docs/react/examples/basic-graphql-request.mdx b/docs/framework/react/examples/basic-graphql-request.mdx similarity index 100% rename from docs/react/examples/basic-graphql-request.mdx rename to docs/framework/react/examples/basic-graphql-request.mdx diff --git a/docs/react/examples/basic.mdx b/docs/framework/react/examples/basic.mdx similarity index 100% rename from docs/react/examples/basic.mdx rename to docs/framework/react/examples/basic.mdx diff --git a/docs/react/examples/custom-hooks.mdx b/docs/framework/react/examples/custom-hooks.mdx similarity index 100% rename from docs/react/examples/custom-hooks.mdx rename to docs/framework/react/examples/custom-hooks.mdx diff --git a/docs/react/examples/default-query-function.mdx b/docs/framework/react/examples/default-query-function.mdx similarity index 100% rename from docs/react/examples/default-query-function.mdx rename to docs/framework/react/examples/default-query-function.mdx diff --git a/docs/react/examples/focus-refetching.mdx b/docs/framework/react/examples/focus-refetching.mdx similarity index 100% rename from docs/react/examples/focus-refetching.mdx rename to docs/framework/react/examples/focus-refetching.mdx diff --git a/docs/react/examples/load-more-infinite-scroll.mdx b/docs/framework/react/examples/load-more-infinite-scroll.mdx similarity index 100% rename from docs/react/examples/load-more-infinite-scroll.mdx rename to docs/framework/react/examples/load-more-infinite-scroll.mdx diff --git a/docs/react/examples/nextjs.mdx b/docs/framework/react/examples/nextjs.mdx similarity index 100% rename from docs/react/examples/nextjs.mdx rename to docs/framework/react/examples/nextjs.mdx diff --git a/docs/react/examples/optimistic-updates-typescript.mdx b/docs/framework/react/examples/optimistic-updates-typescript.mdx similarity index 100% rename from docs/react/examples/optimistic-updates-typescript.mdx rename to docs/framework/react/examples/optimistic-updates-typescript.mdx diff --git a/docs/react/examples/optimistic-updates.mdx b/docs/framework/react/examples/optimistic-updates.mdx similarity index 100% rename from docs/react/examples/optimistic-updates.mdx rename to docs/framework/react/examples/optimistic-updates.mdx diff --git a/docs/react/examples/pagination.mdx b/docs/framework/react/examples/pagination.mdx similarity index 100% rename from docs/react/examples/pagination.mdx rename to docs/framework/react/examples/pagination.mdx diff --git a/docs/react/examples/playground.mdx b/docs/framework/react/examples/playground.mdx similarity index 100% rename from docs/react/examples/playground.mdx rename to docs/framework/react/examples/playground.mdx diff --git a/docs/react/examples/prefetching.mdx b/docs/framework/react/examples/prefetching.mdx similarity index 100% rename from docs/react/examples/prefetching.mdx rename to docs/framework/react/examples/prefetching.mdx diff --git a/docs/react/examples/react-native.mdx b/docs/framework/react/examples/react-native.mdx similarity index 100% rename from docs/react/examples/react-native.mdx rename to docs/framework/react/examples/react-native.mdx diff --git a/docs/react/examples/rick-morty.mdx b/docs/framework/react/examples/rick-morty.mdx similarity index 100% rename from docs/react/examples/rick-morty.mdx rename to docs/framework/react/examples/rick-morty.mdx diff --git a/docs/react/examples/simple.mdx b/docs/framework/react/examples/simple.mdx similarity index 100% rename from docs/react/examples/simple.mdx rename to docs/framework/react/examples/simple.mdx diff --git a/docs/react/examples/star-wars.mdx b/docs/framework/react/examples/star-wars.mdx similarity index 100% rename from docs/react/examples/star-wars.mdx rename to docs/framework/react/examples/star-wars.mdx diff --git a/docs/react/examples/suspense.mdx b/docs/framework/react/examples/suspense.mdx similarity index 100% rename from docs/react/examples/suspense.mdx rename to docs/framework/react/examples/suspense.mdx diff --git a/docs/react/graphql.md b/docs/framework/react/graphql.md similarity index 100% rename from docs/react/graphql.md rename to docs/framework/react/graphql.md diff --git a/docs/react/guides/background-fetching-indicators.md b/docs/framework/react/guides/background-fetching-indicators.md similarity index 100% rename from docs/react/guides/background-fetching-indicators.md rename to docs/framework/react/guides/background-fetching-indicators.md diff --git a/docs/react/guides/caching.md b/docs/framework/react/guides/caching.md similarity index 100% rename from docs/react/guides/caching.md rename to docs/framework/react/guides/caching.md diff --git a/docs/react/guides/default-query-function.md b/docs/framework/react/guides/default-query-function.md similarity index 100% rename from docs/react/guides/default-query-function.md rename to docs/framework/react/guides/default-query-function.md diff --git a/docs/react/guides/dependent-queries.md b/docs/framework/react/guides/dependent-queries.md similarity index 100% rename from docs/react/guides/dependent-queries.md rename to docs/framework/react/guides/dependent-queries.md diff --git a/docs/react/guides/disabling-queries.md b/docs/framework/react/guides/disabling-queries.md similarity index 100% rename from docs/react/guides/disabling-queries.md rename to docs/framework/react/guides/disabling-queries.md diff --git a/docs/react/guides/does-this-replace-client-state.md b/docs/framework/react/guides/does-this-replace-client-state.md similarity index 100% rename from docs/react/guides/does-this-replace-client-state.md rename to docs/framework/react/guides/does-this-replace-client-state.md diff --git a/docs/react/guides/filters.md b/docs/framework/react/guides/filters.md similarity index 100% rename from docs/react/guides/filters.md rename to docs/framework/react/guides/filters.md diff --git a/docs/react/guides/important-defaults.md b/docs/framework/react/guides/important-defaults.md similarity index 100% rename from docs/react/guides/important-defaults.md rename to docs/framework/react/guides/important-defaults.md diff --git a/docs/react/guides/infinite-queries.md b/docs/framework/react/guides/infinite-queries.md similarity index 100% rename from docs/react/guides/infinite-queries.md rename to docs/framework/react/guides/infinite-queries.md diff --git a/docs/react/guides/initial-query-data.md b/docs/framework/react/guides/initial-query-data.md similarity index 100% rename from docs/react/guides/initial-query-data.md rename to docs/framework/react/guides/initial-query-data.md diff --git a/docs/react/guides/invalidations-from-mutations.md b/docs/framework/react/guides/invalidations-from-mutations.md similarity index 100% rename from docs/react/guides/invalidations-from-mutations.md rename to docs/framework/react/guides/invalidations-from-mutations.md diff --git a/docs/react/guides/migrating-to-react-query-3.md b/docs/framework/react/guides/migrating-to-react-query-3.md similarity index 100% rename from docs/react/guides/migrating-to-react-query-3.md rename to docs/framework/react/guides/migrating-to-react-query-3.md diff --git a/docs/react/guides/mutations.md b/docs/framework/react/guides/mutations.md similarity index 100% rename from docs/react/guides/mutations.md rename to docs/framework/react/guides/mutations.md diff --git a/docs/react/guides/optimistic-updates.md b/docs/framework/react/guides/optimistic-updates.md similarity index 100% rename from docs/react/guides/optimistic-updates.md rename to docs/framework/react/guides/optimistic-updates.md diff --git a/docs/react/guides/paginated-queries.md b/docs/framework/react/guides/paginated-queries.md similarity index 100% rename from docs/react/guides/paginated-queries.md rename to docs/framework/react/guides/paginated-queries.md diff --git a/docs/react/guides/parallel-queries.md b/docs/framework/react/guides/parallel-queries.md similarity index 100% rename from docs/react/guides/parallel-queries.md rename to docs/framework/react/guides/parallel-queries.md diff --git a/docs/react/guides/placeholder-query-data.md b/docs/framework/react/guides/placeholder-query-data.md similarity index 100% rename from docs/react/guides/placeholder-query-data.md rename to docs/framework/react/guides/placeholder-query-data.md diff --git a/docs/react/guides/prefetching.md b/docs/framework/react/guides/prefetching.md similarity index 100% rename from docs/react/guides/prefetching.md rename to docs/framework/react/guides/prefetching.md diff --git a/docs/react/guides/queries.md b/docs/framework/react/guides/queries.md similarity index 100% rename from docs/react/guides/queries.md rename to docs/framework/react/guides/queries.md diff --git a/docs/react/guides/query-cancellation.md b/docs/framework/react/guides/query-cancellation.md similarity index 100% rename from docs/react/guides/query-cancellation.md rename to docs/framework/react/guides/query-cancellation.md diff --git a/docs/react/guides/query-functions.md b/docs/framework/react/guides/query-functions.md similarity index 100% rename from docs/react/guides/query-functions.md rename to docs/framework/react/guides/query-functions.md diff --git a/docs/react/guides/query-invalidation.md b/docs/framework/react/guides/query-invalidation.md similarity index 100% rename from docs/react/guides/query-invalidation.md rename to docs/framework/react/guides/query-invalidation.md diff --git a/docs/react/guides/query-keys.md b/docs/framework/react/guides/query-keys.md similarity index 100% rename from docs/react/guides/query-keys.md rename to docs/framework/react/guides/query-keys.md diff --git a/docs/react/guides/query-retries.md b/docs/framework/react/guides/query-retries.md similarity index 100% rename from docs/react/guides/query-retries.md rename to docs/framework/react/guides/query-retries.md diff --git a/docs/react/guides/scroll-restoration.md b/docs/framework/react/guides/scroll-restoration.md similarity index 100% rename from docs/react/guides/scroll-restoration.md rename to docs/framework/react/guides/scroll-restoration.md diff --git a/docs/react/guides/ssr.md b/docs/framework/react/guides/ssr.md similarity index 100% rename from docs/react/guides/ssr.md rename to docs/framework/react/guides/ssr.md diff --git a/docs/react/guides/suspense.md b/docs/framework/react/guides/suspense.md similarity index 100% rename from docs/react/guides/suspense.md rename to docs/framework/react/guides/suspense.md diff --git a/docs/react/guides/testing.md b/docs/framework/react/guides/testing.md similarity index 100% rename from docs/react/guides/testing.md rename to docs/framework/react/guides/testing.md diff --git a/docs/react/guides/updates-from-mutation-responses.md b/docs/framework/react/guides/updates-from-mutation-responses.md similarity index 100% rename from docs/react/guides/updates-from-mutation-responses.md rename to docs/framework/react/guides/updates-from-mutation-responses.md diff --git a/docs/react/guides/window-focus-refetching.md b/docs/framework/react/guides/window-focus-refetching.md similarity index 100% rename from docs/react/guides/window-focus-refetching.md rename to docs/framework/react/guides/window-focus-refetching.md diff --git a/docs/react/installation.md b/docs/framework/react/installation.md similarity index 100% rename from docs/react/installation.md rename to docs/framework/react/installation.md diff --git a/docs/react/overview.md b/docs/framework/react/overview.md similarity index 100% rename from docs/react/overview.md rename to docs/framework/react/overview.md diff --git a/docs/react/plugins/broadcastQueryClient.md b/docs/framework/react/plugins/broadcastQueryClient.md similarity index 100% rename from docs/react/plugins/broadcastQueryClient.md rename to docs/framework/react/plugins/broadcastQueryClient.md diff --git a/docs/react/plugins/createAsyncStoragePersistor.md b/docs/framework/react/plugins/createAsyncStoragePersistor.md similarity index 100% rename from docs/react/plugins/createAsyncStoragePersistor.md rename to docs/framework/react/plugins/createAsyncStoragePersistor.md diff --git a/docs/react/plugins/createWebStoragePersistor.md b/docs/framework/react/plugins/createWebStoragePersistor.md similarity index 100% rename from docs/react/plugins/createWebStoragePersistor.md rename to docs/framework/react/plugins/createWebStoragePersistor.md diff --git a/docs/react/plugins/persistQueryClient.md b/docs/framework/react/plugins/persistQueryClient.md similarity index 100% rename from docs/react/plugins/persistQueryClient.md rename to docs/framework/react/plugins/persistQueryClient.md diff --git a/docs/react/quick-start.md b/docs/framework/react/quick-start.md similarity index 100% rename from docs/react/quick-start.md rename to docs/framework/react/quick-start.md diff --git a/docs/react/react-native.md b/docs/framework/react/react-native.md similarity index 100% rename from docs/react/react-native.md rename to docs/framework/react/react-native.md diff --git a/docs/react/reference/InfiniteQueryObserver.md b/docs/framework/react/reference/InfiniteQueryObserver.md similarity index 100% rename from docs/react/reference/InfiniteQueryObserver.md rename to docs/framework/react/reference/InfiniteQueryObserver.md diff --git a/docs/react/reference/MutationCache.md b/docs/framework/react/reference/MutationCache.md similarity index 100% rename from docs/react/reference/MutationCache.md rename to docs/framework/react/reference/MutationCache.md diff --git a/docs/react/reference/QueriesObserver.md b/docs/framework/react/reference/QueriesObserver.md similarity index 100% rename from docs/react/reference/QueriesObserver.md rename to docs/framework/react/reference/QueriesObserver.md diff --git a/docs/react/reference/QueryCache.md b/docs/framework/react/reference/QueryCache.md similarity index 100% rename from docs/react/reference/QueryCache.md rename to docs/framework/react/reference/QueryCache.md diff --git a/docs/react/reference/QueryClient.md b/docs/framework/react/reference/QueryClient.md similarity index 100% rename from docs/react/reference/QueryClient.md rename to docs/framework/react/reference/QueryClient.md diff --git a/docs/react/reference/QueryClientProvider.md b/docs/framework/react/reference/QueryClientProvider.md similarity index 100% rename from docs/react/reference/QueryClientProvider.md rename to docs/framework/react/reference/QueryClientProvider.md diff --git a/docs/react/reference/QueryErrorResetBoundary.md b/docs/framework/react/reference/QueryErrorResetBoundary.md similarity index 100% rename from docs/react/reference/QueryErrorResetBoundary.md rename to docs/framework/react/reference/QueryErrorResetBoundary.md diff --git a/docs/react/reference/QueryObserver.md b/docs/framework/react/reference/QueryObserver.md similarity index 100% rename from docs/react/reference/QueryObserver.md rename to docs/framework/react/reference/QueryObserver.md diff --git a/docs/react/reference/focusManager.md b/docs/framework/react/reference/focusManager.md similarity index 100% rename from docs/react/reference/focusManager.md rename to docs/framework/react/reference/focusManager.md diff --git a/docs/react/reference/hydration.md b/docs/framework/react/reference/hydration.md similarity index 100% rename from docs/react/reference/hydration.md rename to docs/framework/react/reference/hydration.md diff --git a/docs/react/reference/onlineManager.md b/docs/framework/react/reference/onlineManager.md similarity index 100% rename from docs/react/reference/onlineManager.md rename to docs/framework/react/reference/onlineManager.md diff --git a/docs/react/reference/setLogger.md b/docs/framework/react/reference/setLogger.md similarity index 100% rename from docs/react/reference/setLogger.md rename to docs/framework/react/reference/setLogger.md diff --git a/docs/react/reference/useInfiniteQuery.md b/docs/framework/react/reference/useInfiniteQuery.md similarity index 100% rename from docs/react/reference/useInfiniteQuery.md rename to docs/framework/react/reference/useInfiniteQuery.md diff --git a/docs/react/reference/useIsFetching.md b/docs/framework/react/reference/useIsFetching.md similarity index 100% rename from docs/react/reference/useIsFetching.md rename to docs/framework/react/reference/useIsFetching.md diff --git a/docs/react/reference/useIsMutating.md b/docs/framework/react/reference/useIsMutating.md similarity index 100% rename from docs/react/reference/useIsMutating.md rename to docs/framework/react/reference/useIsMutating.md diff --git a/docs/react/reference/useMutation.md b/docs/framework/react/reference/useMutation.md similarity index 100% rename from docs/react/reference/useMutation.md rename to docs/framework/react/reference/useMutation.md diff --git a/docs/react/reference/useQueries.md b/docs/framework/react/reference/useQueries.md similarity index 100% rename from docs/react/reference/useQueries.md rename to docs/framework/react/reference/useQueries.md diff --git a/docs/react/reference/useQuery.md b/docs/framework/react/reference/useQuery.md similarity index 100% rename from docs/react/reference/useQuery.md rename to docs/framework/react/reference/useQuery.md diff --git a/docs/react/reference/useQueryClient.md b/docs/framework/react/reference/useQueryClient.md similarity index 100% rename from docs/react/reference/useQueryClient.md rename to docs/framework/react/reference/useQueryClient.md diff --git a/docs/react/reference/useQueryErrorResetBoundary.md b/docs/framework/react/reference/useQueryErrorResetBoundary.md similarity index 100% rename from docs/react/reference/useQueryErrorResetBoundary.md rename to docs/framework/react/reference/useQueryErrorResetBoundary.md diff --git a/docs/react/typescript.md b/docs/framework/react/typescript.md similarity index 100% rename from docs/react/typescript.md rename to docs/framework/react/typescript.md diff --git a/docs/react/videos.md b/docs/framework/react/videos.md similarity index 100% rename from docs/react/videos.md rename to docs/framework/react/videos.md diff --git a/docs/jsconfig.json b/docs/jsconfig.json deleted file mode 100644 index 738e8a4650..0000000000 --- a/docs/jsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": "./src" - } -} diff --git a/docs/next.config.js b/docs/next.config.js deleted file mode 100644 index ddc8312614..0000000000 --- a/docs/next.config.js +++ /dev/null @@ -1,100 +0,0 @@ -const path = require('path') -const dotenvLoad = require('dotenv-load') -const optimizedImages = require('next-optimized-images') -dotenvLoad() - -const remarkPlugins = [ - require('remark-slug'), - require('./src/lib/docs/remark-paragraph-alerts'), - [ - require('remark-autolink-headings'), - { - behavior: 'append', - linkProperties: { - class: ['anchor'], - title: 'Direct link to heading', - }, - }, - ], - - require('remark-emoji'), - require('remark-footnotes'), - require('remark-images'), - [ - require('remark-github'), - { repository: 'https://github.com/tannerlinsley/react-query' }, - ], - require('remark-unwrap-images'), - [ - require('remark-toc'), - { - skip: 'Reference', - maxDepth: 6, - }, - ], -] - -module.exports = optimizedImages({ - pageExtensions: ['jsx', 'js', 'mdx', 'md'], - env: { - NEXT_PUBLIC_GA_TRACKING_ID: process.env.GA_TRACKING_ID || '', - SENTRY_RELEASE: process.env.VERCEL_GITHUB_COMMIT_SHA || '', - }, - async redirects() { - return [ - { - source: '/docs/:any*', - destination: '/:any*', // Matched parameters can be used in the destination - permanent: true, - }, - ] - }, - experimental: { - plugins: true, - modern: true, - }, - webpack: (config, { dev, isServer, ...options }) => { - config.module.rules.push({ - test: /.mdx?$/, // load both .md and .mdx files - use: [ - options.defaultLoaders.babel, - { - loader: '@mdx-js/loader', - options: { - remarkPlugins, - }, - }, - path.join(__dirname, './src/lib/docs/md-loader'), - ], - }) - - // only compile build-rss in production server build - if (dev || !isServer) { - return config - } - - // we're in build mode so enable shared caching for Notion data - process.env.USE_CACHE = 'true' - - const originalEntry = config.entry - config.entry = async () => { - const entries = { - ...(await originalEntry()), - } - // entries['./scripts/build-rss.js'] = './src/lib/build-rss.js' - return entries - } - - return config - }, - optimizeImages: { - /* config for next-optimized-images */ - mozjpeg: { - quality: 70, - }, - optipng: { - optimizationLevel: 3, - }, - optimizeImagesInDev: true, - }, -}) diff --git a/docs/package.json b/docs/package.json deleted file mode 100644 index 38fd78758a..0000000000 --- a/docs/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "fdocs3", - "version": "1.0.0", - "main": "index.js", - "author": "Jared Palmer ", - "license": "MIT", - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start", - "index-docs": "node ./.next/serverless/scripts/index-docs.js" - }, - "dependencies": { - "@babel/preset-typescript": "^7.10.4", - "@docsearch/react": "1.0.0-alpha.14", - "@mdx-js/loader": "^1.6.18", - "@mdx-js/mdx": "^1.6.18", - "@mdx-js/react": "^1.6.18", - "@mdx-js/tag": "^0.20.3", - "@next/mdx": "^9.5.3", - "@next/plugin-google-analytics": "^9.5.3", - "@reactions/component": "^2.0.2", - "@visx/responsive": "^1.3.0", - "@zeit/fetch": "^6.0.0", - "@zeit/react-jsx-parser": "^2.0.0", - "async-sema": "^3.1.0", - "axios": "^0.21.1", - "body-scroll-lock": "^3.1.5", - "classnames": "^2.2.6", - "copy-to-clipboard": "^3.3.1", - "country-emoji": "^1.5.6", - "date-fns": "^2.16.1", - "docsearch.js": "^2.6.3", - "framer-motion": "^1.11.1", - "gray-matter": "^4.0.2", - "imagemin-mozjpeg": "^9.0.0", - "imagemin-optipng": "^8.0.0", - "intersection-observer": "^0.10.0", - "isomorphic-unfetch": "^3.0.0", - "next": "^9.5.3", - "next-images": "^1.5.0", - "next-optimized-images": "^2.6.2", - "node-fetch": "^2.6.1", - "prismjs": "^1.21.0", - "react": "^16.13.1", - "react-dom": "^16.13.1", - "react-icons": "^3.11.0", - "react-live": "^2.2.2", - "rehype-format": "^3.0.1", - "rehype-stringify": "^7.0.0", - "remark": "^12.0.1", - "remark-autolink-headings": "^6.0.0", - "remark-emoji": "^2.1.0", - "remark-footnotes": "^1.0.0", - "remark-github": "^9.0.0", - "remark-images": "^2.0.0", - "remark-slug": "^6.0.0", - "remark-toc": "^7.0.0", - "remark-unwrap-images": "^2.0.0", - "scroll-into-view-if-needed": "^2.2.26", - "semver-regex": "^3.1.1", - "unist-util-visit": "^2.0.3" - }, - "devDependencies": { - "@babel/cli": "^7.11.6", - "@babel/core": "^7.11.6", - "@babel/plugin-transform-typescript": "^7.11.0", - "@babel/preset-react": "^7.10.4", - "@tailwindcss/ui": "^0.3.0", - "algoliasearch": "3.35.1", - "babel-preset-react-app": "^9.1.2", - "dotenv-load": "^2.0.0", - "github-slugger": "^1.3.0", - "md5": "^2.3.0", - "mdast-util-to-string": "^1.1.0", - "postcss-preset-env": "^6.7.0", - "remark-parse": "^8.0.3", - "tailwindcss": "^1.8.10", - "unified": "^9.2.0", - "webp-loader": "^0.6.0" - } -} diff --git a/docs/postcss.config.js b/docs/postcss.config.js deleted file mode 100644 index 7129bb14f2..0000000000 --- a/docs/postcss.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - plugins: ['tailwindcss', 'postcss-preset-env'], -}; diff --git a/docs/public/images/bytes-logo.png b/docs/public/images/bytes-logo.png deleted file mode 100644 index 26ca9143ce..0000000000 Binary files a/docs/public/images/bytes-logo.png and /dev/null differ diff --git a/docs/public/robots.txt b/docs/public/robots.txt deleted file mode 100644 index 6f27bb66a3..0000000000 --- a/docs/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -Disallow: \ No newline at end of file diff --git a/docs/src/components/ArrowRight.js b/docs/src/components/ArrowRight.js deleted file mode 100644 index 12f92b3f78..0000000000 --- a/docs/src/components/ArrowRight.js +++ /dev/null @@ -1,10 +0,0 @@ -import * as React from 'react'; -export function ArrowRight({ - fill = '#718096', - width = 6, - height = 10 -}) { - return - - ; -} \ No newline at end of file diff --git a/docs/src/components/Banner.js b/docs/src/components/Banner.js deleted file mode 100644 index 8aaa81391c..0000000000 --- a/docs/src/components/Banner.js +++ /dev/null @@ -1,12 +0,0 @@ -export function Banner() { - return null; // return ( - //
- //
- // formium - //
- // Hassle-free form storage for static sites → - //
- //
- //
- // ); -} \ No newline at end of file diff --git a/docs/src/components/BytesForm.js b/docs/src/components/BytesForm.js deleted file mode 100644 index 168fcf975f..0000000000 --- a/docs/src/components/BytesForm.js +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react' -import useBytesSubmit from './useBytesSubmit' - -export default function BytesForm() { - const { state, handleSubmit, error } = useBytesSubmit() - if (state === 'submitted') { - return ( -

Success! Please, check your email to confirm your subscription.

- ) - } - return ( -
-
-
- Bytes -
- - -
-

- No spam. Unsubscribe at any time. -

- {error &&

{error}

} -
- ) -} diff --git a/docs/src/components/CarbonAds.js b/docs/src/components/CarbonAds.js deleted file mode 100644 index fe8097bffd..0000000000 --- a/docs/src/components/CarbonAds.js +++ /dev/null @@ -1,45 +0,0 @@ -import React from 'react' - -function buildScript(src, attrs = {}) { - if (typeof document !== 'undefined') { - const script = document.createElement('script') - script.async = true - script.defer = true - Object.keys(attrs).forEach(attr => script.setAttribute(attr, attrs[attr])) - script.src = src - - return script - } -} - -export default function CarbonAds() { - const ref = React.useRef() - - React.useEffect(() => { - const script = buildScript( - '//cdn.carbonads.com/carbon.js?serve=CESDV23N&placement=react-querytanstackcom', - { - type: 'text/javascript', - id: '_carbonads_js', - } - ) - - ref.current.appendChild(script) - }, []) - - React.useEffect(() => { - const interval = setInterval(() => { - ;[...ref.current.children].forEach(child => { - if (child.id.startsWith('carbonads_')) { - ref.current.removeChild(child) - } - }) - }, 100) - - return () => { - clearInterval(interval) - } - }) - - return
-} diff --git a/docs/src/components/CodeBlock.js b/docs/src/components/CodeBlock.js deleted file mode 100644 index cf456ed1d2..0000000000 --- a/docs/src/components/CodeBlock.js +++ /dev/null @@ -1,125 +0,0 @@ -import React, { useState } from 'react'; -import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live'; -import { mdx } from '@mdx-js/react'; -import { TWButton } from './TWButton'; -import { useClipboard } from './useClipboard'; -import Component from '@reactions/component'; -export const liveEditorStyle = { - fontSize: 14, - overflowX: 'auto', - color: '#f8f8f2', - fontFamily: 'SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace', - height: '100%', - background: '#161e2e' -}; -export const liveErrorStyle = { - fontFamily: 'SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace', - fontSize: 12, - padding: '1em', - overflowX: 'auto', - color: 'white', - backgroundColor: 'red' -}; - -const LiveCodePreview = props =>
- -
; - -const EditableNotice = props => { - return
- Editable Example -
; -}; - -const CodeBlock = ({ - className, - live = false, - noInline = false, - collapsed = false, - isManual, - render, - children, - ...props -}) => { - const initialCode = React.useRef(children.trim()); - const [editorCode, setEditorCode] = useState(children.trim()); - const language = className && className.replace(/language-/, ''); - const [hasCopied, onCopy] = useClipboard(editorCode); - const [isCollapsed, setCollapse] = React.useState(collapsed); - const liveProviderProps = { - theme: { - plain: {}, - styles: [] - }, - language, - code: editorCode, - transformCode: code => `<>${code}`, - scope: { - mdx, - Component - }, - noInline, - ...props - }; - - const handleCodeChange = newCode => setEditorCode(newCode ? newCode.trim() : ''); - - if (language === 'jsx' && live === true) { - return -
- - - {isCollapsed ?
- -
: <> -
- -
- - {hasCopied ? 'Copied' : 'Copy'} - - setEditorCode(initialCode.current)}> - Reset - -
-
- - -
- -
- } -
-
; - } - - if (render) { - return
- - - -
; - } - - return -
- -
- - {hasCopied ? 'Copied' : 'Copy'} - -
-
-
; -}; - -CodeBlock.defaultProps = { - mountStylesheet: false -}; -export default CodeBlock; \ No newline at end of file diff --git a/docs/src/components/Container.js b/docs/src/components/Container.js deleted file mode 100644 index 2c0c3123a2..0000000000 --- a/docs/src/components/Container.js +++ /dev/null @@ -1,6 +0,0 @@ -import * as React from 'react'; -import cn from 'classnames'; -export const Container = props => { - return
; -}; -Container.displayName = 'Container'; \ No newline at end of file diff --git a/docs/src/components/DocsPageFooter.js b/docs/src/components/DocsPageFooter.js deleted file mode 100644 index 367c433867..0000000000 --- a/docs/src/components/DocsPageFooter.js +++ /dev/null @@ -1,76 +0,0 @@ -import * as React from 'react' -import NextLink from 'next/link' -import { removeFromLast } from '../lib/docs/utils' -import { siteConfig } from 'siteConfig' -import { FiThumbsDown, FiThumbsUp } from 'react-icons/fi' -import { TWButton } from './TWButton' - -function areEqual(prevProps, props) { - return prevProps.route?.path === props.route?.path -} - -export const DocsPageFooter = React.memo(({ route, prevRoute, nextRoute }) => { - const editUrl = - route?.editUrl || route?.path - ? `${siteConfig.editUrl}${route?.editUrl || route?.path}` - : null - - return ( - <> -
-
- {prevRoute && prevRoute.path ? ( - - - - ← Prev - - - {prevRoute.title} - - - - ) : ( -
- )} - {nextRoute && nextRoute.path && ( - - - - Next → - - - {nextRoute.title} - - - - )} -
-
- - {editUrl ? ( - - ) : null} - -
-
- Was this page helpful? -
-
- }>Yes - }>No -
-
- - ) -}, areEqual) -DocsPageFooter.displayName = 'DocsPageFooter' diff --git a/docs/src/components/ExternalLink.js b/docs/src/components/ExternalLink.js deleted file mode 100644 index 17b7d34b67..0000000000 --- a/docs/src/components/ExternalLink.js +++ /dev/null @@ -1,4 +0,0 @@ -import * as React from 'react'; -export function ExternalLink(props) { - return ; -} \ No newline at end of file diff --git a/docs/src/components/Footer.js b/docs/src/components/Footer.js deleted file mode 100644 index 1beec91d4b..0000000000 --- a/docs/src/components/Footer.js +++ /dev/null @@ -1,141 +0,0 @@ -import * as React from 'react' -import Link from 'next/link' -import CarbonAds from './CarbonAds' -import BytesForm from './BytesForm' - -export const Footer = props => { - return ( -
-
-
- - -
- -
-
-

- Subscribe to Bytes -

-

- The{' '} - - best JavaScript newsletter! - {' '} - Delivered every Monday to over 76,000 devs. -

- -
-
-
- -

- © 2020 Tanner Linsley. All rights reserved. -

-
-
-
- ) -} -Footer.displayName = 'Footer' diff --git a/docs/src/components/Highlight.js b/docs/src/components/Highlight.js deleted file mode 100644 index ea04392372..0000000000 --- a/docs/src/components/Highlight.js +++ /dev/null @@ -1,140 +0,0 @@ -import * as React from 'react'; -import Highlight, { defaultProps } from 'prism-react-renderer'; -import { LiveProvider, LiveEditor, LiveError, LivePreview } from 'react-live'; // Original: https://raw.githubusercontent.com/PrismJS/prism-themes/master/themes/prism-ghcolors.css - -/*:: import type { PrismTheme } from '../src/types' */ - -const theme -/*: PrismTheme */ -= { - plain: { - color: '#293742', - borderRadius: 12, - fontFamily: `SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace`, - fontSize: 14, - lineHeight: '1.5' - }, - styles: [{ - types: ['comment', 'prolog', 'doctype', 'cdata'], - style: { - color: '#A7B6C2', - fontStyle: 'italic' - } - }, { - types: ['namespace'], - style: { - opacity: 0.7 - } - }, { - types: ['string', 'attr-value'], - style: { - color: '#DB2C6F' - } - }, { - types: ['punctuation', 'operator'], - style: { - color: '#394B59' - } - }, { - types: ['entity', 'url', 'symbol', 'number', 'boolean', 'variable', 'constant', 'property', 'regex', 'inserted'], - style: { - color: '#36acaa' - } - }, { - types: ['atrule', 'keyword', 'attr-name', 'selector'], - style: { - color: '#00B3A4' - } - }, { - types: ['function', 'deleted', 'tag'], - style: { - color: '#DB2C6F' - } - }, { - types: ['function-variable'], - style: { - color: '#634DBF' - } - }, { - types: ['tag', 'selector', 'keyword'], - style: { - color: '#1a56db' - } - }] -}; - -const Code = ({ - children, - codeString, - className = 'language-js', - ...props -}) => { - const language = className.replace(/language-/, ''); - const [key, setKey] = React.useState(`${Math.random() * 7}`); - - if (props['live']) { - return
- -
-
Live JSX Editor
-
- -
-
-
- -
-
-
-
Live Preview
-
-
- - -
-
-
-
; - } else { - return - {({ - className, - style, - tokens, - getLineProps, - getTokenProps - }) =>
-            {tokens.map((line, i) => 
- {tokens.length > 1 ? : }{' '} - {line.map((token, key) => )} -
)} -
} -
; - } -}; - -export default Code; \ No newline at end of file diff --git a/docs/src/components/Highlight2.js b/docs/src/components/Highlight2.js deleted file mode 100644 index 93556a560a..0000000000 --- a/docs/src/components/Highlight2.js +++ /dev/null @@ -1,100 +0,0 @@ -import * as React from 'react'; -import Highlight, { defaultProps } from 'prism-react-renderer'; -// Original: https://raw.githubusercontent.com/PrismJS/prism-themes/master/themes/prism-ghcolors.css - -/*:: import type { PrismTheme } from '../src/types' */ -const theme -/*: PrismTheme */ -= { - plain: { - color: '#293742', - borderRadius: 12, - fontFamily: `SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace`, - fontSize: 14, - lineHeight: '1.5' - }, - styles: [{ - types: ['comment', 'prolog', 'doctype', 'cdata'], - style: { - color: '#A7B6C2', - fontStyle: 'italic' - } - }, { - types: ['namespace'], - style: { - opacity: 0.7 - } - }, { - types: ['string', 'attr-value'], - style: { - color: '#DB2C6F' - } - }, { - types: ['punctuation', 'operator'], - style: { - color: '#394B59' - } - }, { - types: ['entity', 'url', 'symbol', 'number', 'boolean', 'variable', 'constant', 'property', 'regex', 'inserted'], - style: { - color: '#36acaa' - } - }, { - types: ['atrule', 'keyword', 'attr-name', 'selector'], - style: { - color: '#00B3A4' - } - }, { - types: ['function', 'deleted', 'tag'], - style: { - color: '#DB2C6F' - } - }, { - types: ['function-variable'], - style: { - color: '#634DBF' - } - }, { - types: ['tag', 'selector', 'keyword'], - style: { - color: '#1a56db' - } - }] -}; - -const Code = ({ - children, - codeString, - className = 'language-js', - ...props -}) => { - const language = className.replace(/language-/, ''); - return - {({ - className, - style, - tokens, - getLineProps, - getTokenProps - }) =>
-          {tokens.map((line, i) => 
- {tokens.length > 1 ? : }{' '} - {line.map((token, key) => )} -
)} -
} -
; -}; - -export default Code; \ No newline at end of file diff --git a/docs/src/components/LayoutDocs.js b/docs/src/components/LayoutDocs.js deleted file mode 100644 index df5aa8857a..0000000000 --- a/docs/src/components/LayoutDocs.js +++ /dev/null @@ -1,228 +0,0 @@ -import * as React from 'react' -import { MDXProvider } from '@mdx-js/react' -import { Nav } from 'components/Nav' -import { Sidebar } from 'components/Sidebar' -import { SidebarCategory } from 'components/SidebarCategory' -import { SidebarHeading } from 'components/SidebarHeading' -import { SidebarMobile } from 'components/SidebarMobile' -import { SidebarPost } from 'components/SidebarPost' -import { Sticky } from 'components/Sticky' -import { useIsMobile } from 'components/useIsMobile' -import { findRouteByPath } from 'lib/docs/findRouteByPath' -import { removeFromLast } from 'lib/docs/utils' -import { getRouteContext } from 'lib/get-route-context' -import { useRouter } from 'next/router' -import { Toc } from './Toc' -import s from './markdown.module.css' -import { Footer } from './Footer' -import { DocsPageFooter } from './DocsPageFooter' -import { Seo } from './Seo' -import MDXComponents from './MDXComponents' -import Head from 'next/head' -import { getManifest } from 'manifests/getManifest' -import BytesForm from './BytesForm' - -const getSlugAndTag = path => { - const parts = path.split('/') - - if (parts[2] === '1.5.8' || parts[2] === '2.1.4') { - return { - tag: parts[2], - slug: `/docs/${parts.slice(2).join('/')}`, - } - } - - return { - slug: path, - } -} - -const addTagToSlug = (slug, tag) => { - return tag ? `/docs/${tag}/${slug.replace('/docs/', '')}` : slug -} - -export const LayoutDocs = props => { - const router = useRouter() - const { slug, tag } = getSlugAndTag(router.asPath) - const { routes } = getManifest(tag) - - const _route = findRouteByPath(removeFromLast(slug, '#'), routes) // @ts-ignore - - const isMobile = useIsMobile() - const { route, prevRoute, nextRoute } = getRouteContext(_route, routes) - const title = route && `${route.title}` - - return ( - <> - {tag && ( - - - - )} -
- {isMobile ? ( - <> -
-