From 60654503d77f83d87ab00a7c3af8077cab659793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20Emir=20=C5=9Een?= Date: Tue, 13 Feb 2024 11:40:58 +0300 Subject: [PATCH] docs(tutorial): move login to pages --- .../authentication/logging-in-out/index.md | 8 ++++---- .../authentication/logging-in-out/sandpack.tsx | 18 +++++++++--------- .../react-router/ant-design/index.md | 2 +- .../react-router/ant-design/sandpack.tsx | 2 +- .../authentication/react-router/index.md | 2 +- .../authentication/react-router/sandpack.tsx | 2 +- .../routing/intro/react-router/index.md | 2 +- .../routing/intro/react-router/sandpack.tsx | 2 +- .../resource-definition/react-router/index.md | 4 ++-- .../react-router/sandpack.tsx | 4 ++-- .../ant-design/react-router/index.md | 4 ++-- .../ant-design/react-router/sandpack.tsx | 6 +++--- .../intro/ant-design/react-router/index.md | 4 ++-- .../intro/ant-design/react-router/sandpack.tsx | 4 ++-- .../layout/ant-design/react-router/index.md | 2 +- .../ant-design/react-router/sandpack.tsx | 2 +- .../ant-design/react-router/index.md | 2 +- .../ant-design/react-router/sandpack.tsx | 2 +- 18 files changed, 36 insertions(+), 36 deletions(-) diff --git a/documentation/tutorial/authentication/logging-in-out/index.md b/documentation/tutorial/authentication/logging-in-out/index.md index 82b8b5ff06d5..d69a7a92d0bd 100644 --- a/documentation/tutorial/authentication/logging-in-out/index.md +++ b/documentation/tutorial/authentication/logging-in-out/index.md @@ -85,7 +85,7 @@ import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; // highlight-next-line -import { Login } from "./components/login"; +import { Login } from "./pages/login"; export default function App(): JSX.Element { return ( @@ -109,9 +109,9 @@ export default function App(): JSX.Element { Finally, we'll import `useLogin` hook and use it inside our `Login` component to login our users. -Try to add the following lines to your `src/components/login.tsx` file: +Try to add the following lines to your `src/pages/login.tsx` file: -```tsx title="src/components/login.tsx" +```tsx title="src/pages/login.tsx" import React from "react"; // highlight-next-line import { useLogin } from "@refinedev/core"; @@ -239,7 +239,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; // highlight-next-line import { Header } from "./components/header"; diff --git a/documentation/tutorial/authentication/logging-in-out/sandpack.tsx b/documentation/tutorial/authentication/logging-in-out/sandpack.tsx index 16a6df7ccd5b..af9ef862f54e 100644 --- a/documentation/tutorial/authentication/logging-in-out/sandpack.tsx +++ b/documentation/tutorial/authentication/logging-in-out/sandpack.tsx @@ -84,7 +84,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; export default function App(): JSX.Element { return ( @@ -220,7 +220,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { @@ -293,14 +293,14 @@ export const CreateLoginComponentFile = () => { { sandpack.addFile({ - "src/components/login.tsx": { + "src/pages/login.tsx": { code: LoginComponentBase, }, }); - sandpack.openFile("src/components/login.tsx"); - sandpack.setActiveFile("src/components/login.tsx"); + sandpack.openFile("src/pages/login.tsx"); + sandpack.setActiveFile("src/pages/login.tsx"); }} - name="src/components/login.tsx" + name="src/pages/login.tsx" /> ); }; @@ -325,10 +325,10 @@ export const AddUseLoginToLoginComponent = () => { { sandpack.updateFile( - "src/components/login.tsx", + "src/pages/login.tsx", LoginComponentWithUseLogin, ); - sandpack.setActiveFile("src/components/login.tsx"); + sandpack.setActiveFile("src/pages/login.tsx"); }} /> ); @@ -408,7 +408,7 @@ export const finalFiles = { "src/providers/auth-provider.ts": { code: AuthProviderTsxWithLogoutMethod, }, - "src/components/login.tsx": { + "src/pages/login.tsx": { code: LoginComponentWithUseLogin, }, "src/components/header.tsx": { diff --git a/documentation/tutorial/next-steps/inferencer/react-router/ant-design/index.md b/documentation/tutorial/next-steps/inferencer/react-router/ant-design/index.md index 7d2be8500aad..0bf015fa5a5a 100644 --- a/documentation/tutorial/next-steps/inferencer/react-router/ant-design/index.md +++ b/documentation/tutorial/next-steps/inferencer/react-router/ant-design/index.md @@ -80,7 +80,7 @@ import { CreateProduct } from "./pages/products/create"; // highlight-next-line import { ListCategories } from "./pages/categories/list"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import "antd/dist/reset.css"; diff --git a/documentation/tutorial/next-steps/inferencer/react-router/ant-design/sandpack.tsx b/documentation/tutorial/next-steps/inferencer/react-router/ant-design/sandpack.tsx index 36df6a6eace2..3e23e1bb00d4 100644 --- a/documentation/tutorial/next-steps/inferencer/react-router/ant-design/sandpack.tsx +++ b/documentation/tutorial/next-steps/inferencer/react-router/ant-design/sandpack.tsx @@ -53,7 +53,7 @@ import { CreateProduct } from "./pages/products/create"; import { ListCategories } from "./pages/categories/list"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import "antd/dist/reset.css"; diff --git a/documentation/tutorial/routing/authentication/react-router/index.md b/documentation/tutorial/routing/authentication/react-router/index.md index 8212aba96e63..d922db089c10 100644 --- a/documentation/tutorial/routing/authentication/react-router/index.md +++ b/documentation/tutorial/routing/authentication/react-router/index.md @@ -60,7 +60,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { diff --git a/documentation/tutorial/routing/authentication/react-router/sandpack.tsx b/documentation/tutorial/routing/authentication/react-router/sandpack.tsx index 61d18a822ef4..5aeacd2f7a02 100644 --- a/documentation/tutorial/routing/authentication/react-router/sandpack.tsx +++ b/documentation/tutorial/routing/authentication/react-router/sandpack.tsx @@ -44,7 +44,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { diff --git a/documentation/tutorial/routing/intro/react-router/index.md b/documentation/tutorial/routing/intro/react-router/index.md index 0ef2ad54ba02..55698db5ccb8 100644 --- a/documentation/tutorial/routing/intro/react-router/index.md +++ b/documentation/tutorial/routing/intro/react-router/index.md @@ -56,7 +56,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { diff --git a/documentation/tutorial/routing/intro/react-router/sandpack.tsx b/documentation/tutorial/routing/intro/react-router/sandpack.tsx index 8666e3db69dc..808a6b0011cc 100644 --- a/documentation/tutorial/routing/intro/react-router/sandpack.tsx +++ b/documentation/tutorial/routing/intro/react-router/sandpack.tsx @@ -36,7 +36,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { diff --git a/documentation/tutorial/routing/resource-definition/react-router/index.md b/documentation/tutorial/routing/resource-definition/react-router/index.md index 88be65afac9c..3939b16bae3f 100644 --- a/documentation/tutorial/routing/resource-definition/react-router/index.md +++ b/documentation/tutorial/routing/resource-definition/react-router/index.md @@ -44,7 +44,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { @@ -133,7 +133,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { diff --git a/documentation/tutorial/routing/resource-definition/react-router/sandpack.tsx b/documentation/tutorial/routing/resource-definition/react-router/sandpack.tsx index ecfd553bd7c0..9e1ce47bc3d8 100644 --- a/documentation/tutorial/routing/resource-definition/react-router/sandpack.tsx +++ b/documentation/tutorial/routing/resource-definition/react-router/sandpack.tsx @@ -36,7 +36,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { @@ -97,7 +97,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; export default function App(): JSX.Element { diff --git a/documentation/tutorial/ui-libraries/authentication/ant-design/react-router/index.md b/documentation/tutorial/ui-libraries/authentication/ant-design/react-router/index.md index 6b76044470b9..5de92b9d5b77 100644 --- a/documentation/tutorial/ui-libraries/authentication/ant-design/react-router/index.md +++ b/documentation/tutorial/ui-libraries/authentication/ant-design/react-router/index.md @@ -21,9 +21,9 @@ Now we've refactored our application with Ant Design, we only have one thing lef Now let's update our `` component to use the `` from `@refinedev/antd` package. This component will provide a consistent look and feel with the rest of the application. -Try to update the `src/components/login.tsx` file with the following lines: +Try to update the `src/pages/login.tsx` file with the following lines: -```tsx title="src/components/login.tsx" +```tsx title="src/pages/login.tsx" import React from "react"; import { AuthPage } from "@refinedev/antd"; diff --git a/documentation/tutorial/ui-libraries/authentication/ant-design/react-router/sandpack.tsx b/documentation/tutorial/ui-libraries/authentication/ant-design/react-router/sandpack.tsx index 5a41d013debd..c2a0ef4b0a42 100644 --- a/documentation/tutorial/ui-libraries/authentication/ant-design/react-router/sandpack.tsx +++ b/documentation/tutorial/ui-libraries/authentication/ant-design/react-router/sandpack.tsx @@ -51,10 +51,10 @@ export const UseAuthPageInLogin = () => { { sandpack.updateFile( - "src/components/login.tsx", + "src/pages/login.tsx", LoginTsxWithAuthPage, ); - sandpack.setActiveFile("src/components/login.tsx"); + sandpack.setActiveFile("src/pages/login.tsx"); }} /> ); @@ -64,7 +64,7 @@ export const UseAuthPageInLogin = () => { export const finalFiles = { ...removeActiveFromFiles(initialFiles), - "src/components/login.tsx": { + "src/pages/login.tsx": { code: LoginTsxWithAuthPage, active: true, }, diff --git a/documentation/tutorial/ui-libraries/intro/ant-design/react-router/index.md b/documentation/tutorial/ui-libraries/intro/ant-design/react-router/index.md index 568988ad6976..836cf296905d 100644 --- a/documentation/tutorial/ui-libraries/intro/ant-design/react-router/index.md +++ b/documentation/tutorial/ui-libraries/intro/ant-design/react-router/index.md @@ -47,7 +47,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; // highlight-start @@ -148,7 +148,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import "antd/dist/reset.css"; diff --git a/documentation/tutorial/ui-libraries/intro/ant-design/react-router/sandpack.tsx b/documentation/tutorial/ui-libraries/intro/ant-design/react-router/sandpack.tsx index 706eba4eb99e..ac7b58842cf0 100644 --- a/documentation/tutorial/ui-libraries/intro/ant-design/react-router/sandpack.tsx +++ b/documentation/tutorial/ui-libraries/intro/ant-design/react-router/sandpack.tsx @@ -39,7 +39,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import { Header } from "./components/header"; // We're importing a reset.css file to reset the default styles of the browser. @@ -124,7 +124,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; // We're importing a reset.css file to reset the default styles of the browser. import "antd/dist/reset.css"; diff --git a/documentation/tutorial/ui-libraries/layout/ant-design/react-router/index.md b/documentation/tutorial/ui-libraries/layout/ant-design/react-router/index.md index 874ed968df4e..b8faf8992aed 100644 --- a/documentation/tutorial/ui-libraries/layout/ant-design/react-router/index.md +++ b/documentation/tutorial/ui-libraries/layout/ant-design/react-router/index.md @@ -47,7 +47,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import "antd/dist/reset.css"; diff --git a/documentation/tutorial/ui-libraries/layout/ant-design/react-router/sandpack.tsx b/documentation/tutorial/ui-libraries/layout/ant-design/react-router/sandpack.tsx index 01e3216f2d6b..72204b7eda12 100644 --- a/documentation/tutorial/ui-libraries/layout/ant-design/react-router/sandpack.tsx +++ b/documentation/tutorial/ui-libraries/layout/ant-design/react-router/sandpack.tsx @@ -42,7 +42,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import "antd/dist/reset.css"; diff --git a/documentation/tutorial/ui-libraries/notifications/ant-design/react-router/index.md b/documentation/tutorial/ui-libraries/notifications/ant-design/react-router/index.md index 6a37f7e4e206..4795618418c4 100644 --- a/documentation/tutorial/ui-libraries/notifications/ant-design/react-router/index.md +++ b/documentation/tutorial/ui-libraries/notifications/ant-design/react-router/index.md @@ -42,7 +42,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import "antd/dist/reset.css"; diff --git a/documentation/tutorial/ui-libraries/notifications/ant-design/react-router/sandpack.tsx b/documentation/tutorial/ui-libraries/notifications/ant-design/react-router/sandpack.tsx index d91b6ae1aa83..85fe8f574506 100644 --- a/documentation/tutorial/ui-libraries/notifications/ant-design/react-router/sandpack.tsx +++ b/documentation/tutorial/ui-libraries/notifications/ant-design/react-router/sandpack.tsx @@ -40,7 +40,7 @@ import { EditProduct } from "./pages/products/edit"; import { ListProducts } from "./pages/products/list"; import { CreateProduct } from "./pages/products/create"; -import { Login } from "./components/login"; +import { Login } from "./pages/login"; import "antd/dist/reset.css";