From 055d9fae4265e4084a49ca0c1803513248edf6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20K=C3=B6nig?= Date: Sat, 6 Apr 2024 20:22:52 +0200 Subject: [PATCH] fix: adjusts scroll position --- app/components/workflow-cards.tsx | 27 +++++++++++++++++++ .../_frontend.$category._index/route.tsx | 20 +++----------- 2 files changed, 30 insertions(+), 17 deletions(-) create mode 100644 app/components/workflow-cards.tsx diff --git a/app/components/workflow-cards.tsx b/app/components/workflow-cards.tsx new file mode 100644 index 0000000..b83f9d1 --- /dev/null +++ b/app/components/workflow-cards.tsx @@ -0,0 +1,27 @@ +import { Link } from "@remix-run/react"; +import { WorkflowCard } from "./workflow-card"; + +type Props = Readonly<{ + workflows: ReadonlyArray<{ + id: string; + name: string; + description: string; + category: string; + title: string; + }>; +}>; + +export function WorkflowCards(props: Props) { + return props.workflows.map((workflow) => ( + + Use Workflow} + /> + + )); +} diff --git a/app/routes/_frontend.$category._index/route.tsx b/app/routes/_frontend.$category._index/route.tsx index aece176..6821b8d 100644 --- a/app/routes/_frontend.$category._index/route.tsx +++ b/app/routes/_frontend.$category._index/route.tsx @@ -1,7 +1,7 @@ import { getCategories } from "#workflows"; import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; -import { Link, json, redirect, useLoaderData } from "@remix-run/react"; -import { WorkflowCard } from "~/components/workflow-card"; +import { json, redirect, useLoaderData } from "@remix-run/react"; +import { WorkflowCards } from "~/components/workflow-cards"; import { WorkflowSwitcher } from "~/components/workflow-switcher"; import { getBaseUrl } from "~/utils/get-base-url.server"; import { getWorkflows } from "./query"; @@ -102,21 +102,7 @@ export default function Index() {
- {loaderData.workflows.map((workflow) => ( - - Use Workflow - } - /> - - ))} +
);