From a0341c97c19784a75a05124de6186ec09ca47541 Mon Sep 17 00:00:00 2001 From: Ahmad Rifqy Date: Sun, 19 Mar 2023 22:34:57 +0700 Subject: [PATCH] docs(tutorials/jokes): remove unused imports (#5842) --- contributors.yml | 1 + docs/tutorials/jokes.md | 22 +++++++--------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/contributors.yml b/contributors.yml index 9477aa4013a..bbddddbd8d8 100644 --- a/contributors.yml +++ b/contributors.yml @@ -507,3 +507,4 @@ - zainfathoni - zayenz - zhe +- arifqys diff --git a/docs/tutorials/jokes.md b/docs/tutorials/jokes.md index 7c526d3b7e7..9aa445aa17d 100644 --- a/docs/tutorials/jokes.md +++ b/docs/tutorials/jokes.md @@ -1801,8 +1801,7 @@ const [randomJoke] = await db.joke.findMany({ app/routes/jokes/index.tsx -```tsx filename=app/routes/jokes/index.tsx lines=[5,7-15,18] -import type { LoaderArgs } from "@remix-run/node"; +```tsx filename=app/routes/jokes/index.tsx lines=[1-2,4,6-14,17] import { json } from "@remix-run/node"; import { useLoaderData, Link } from "@remix-run/react"; @@ -2518,12 +2517,11 @@ Great, now that we've got the UI looking nice, let's add some logic. This will b app/routes/login.tsx -```tsx filename=app/routes/login.tsx lines=[2,5,8,13-14,20-24,26-30,32-38,40-112,115,138-141,150-153,164-172,174-182,190-198,200-208,210-219] +```tsx filename=app/routes/login.tsx lines=[2,7,12-13,19-23,25-29,31-37,39-111,114,137-140,149-152,163-171,173-181,189-197,199-207,209-218] import type { ActionArgs, LinksFunction, } from "@remix-run/node"; -import { json } from "@remix-run/node"; import { Link, useActionData, @@ -3133,7 +3131,7 @@ You may also notice that our solution makes use of the `login` route's `redirect ```tsx filename=app/routes/jokes/new.tsx lines=[7,22,51] import type { ActionArgs } from "@remix-run/node"; -import { json, redirect } from "@remix-run/node"; +import { redirect } from "@remix-run/node"; import { useActionData } from "@remix-run/react"; import { db } from "~/utils/db.server"; @@ -3505,10 +3503,7 @@ export default function JokesRoute() { app/routes/logout.tsx ```tsx filename=app/routes/logout.tsx -import type { - ActionArgs, - LoaderArgs, -} from "@remix-run/node"; +import type { ActionArgs } from "@remix-run/node"; import { redirect } from "@remix-run/node"; import { logout } from "~/utils/session.server"; @@ -3687,12 +3682,11 @@ export async function createUserSession( app/routes/login.tsx -```tsx filename=app/routes/login.tsx lines=[18,102-110] +```tsx filename=app/routes/login.tsx lines=[17,101-109] import type { ActionArgs, LinksFunction, } from "@remix-run/node"; -import { json } from "@remix-run/node"; import { Link, useActionData, @@ -5011,13 +5005,12 @@ export default function IndexRoute() { app/routes/login.tsx -```tsx filename=app/routes/login.tsx lines=[4,22-25] +```tsx filename=app/routes/login.tsx lines=[4,21-24] import type { ActionArgs, LinksFunction, MetaFunction, } from "@remix-run/node"; -import { json } from "@remix-run/node"; import { Link, useActionData, @@ -5747,7 +5740,7 @@ export function JokeDisplay({ app/routes/jokes/$jokeId.tsx -```tsx filename=app/routes/jokes/$jokeId.tsx lines=[14,89] +```tsx filename=app/routes/jokes/$jokeId.tsx lines=[13,88] import type { ActionArgs, LoaderArgs, @@ -5755,7 +5748,6 @@ import type { } from "@remix-run/node"; import { json, redirect } from "@remix-run/node"; import { - Link, useCatch, useLoaderData, useParams,