Skip to content

Commit 66ad24d

Browse files
committed
Animate the progress bar
1 parent 2673617 commit 66ad24d

File tree

1 file changed

+11
-10
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam

1 file changed

+11
-10
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Form, useRevalidator } from "@remix-run/react";
33
import { ActionFunctionArgs, type LoaderFunctionArgs } from "@remix-run/server-runtime";
44
import { tryCatch } from "@trigger.dev/core";
55
import { BulkActionStatus, BulkActionType } from "@trigger.dev/database";
6+
import { motion } from "framer-motion";
67
import { useEffect } from "react";
78
import { typedjson, useTypedLoaderData } from "remix-typedjson";
89
import { z } from "zod";
@@ -290,17 +291,17 @@ function Meter({ type, successCount, failureCount, totalCount }: MeterProps) {
290291
</Paragraph>
291292
</div>
292293
<div className="relative h-4 w-full overflow-hidden rounded-sm bg-charcoal-900">
293-
<SimpleTooltip
294-
content={`${formatNumber(successCount)} ${typeText(type)} successfully`}
295-
buttonClassName="h-full absolute w-full top-0 left-0 bg-success"
296-
buttonStyle={{ width: `${successPercentage}%` }}
297-
button={<div className="h-full w-full" />}
294+
<motion.div
295+
className="absolute left-0 top-0 h-full w-full bg-success"
296+
initial={{ width: `${successPercentage}%` }}
297+
animate={{ width: `${successPercentage}%` }}
298+
transition={{ duration: 0.3, ease: "easeOut" }}
298299
/>
299-
<SimpleTooltip
300-
content={`${formatNumber(failureCount)} ${typeText(type)} failed`}
301-
buttonClassName="h-full absolute top-0 bg-charcoal-550"
302-
buttonStyle={{ left: `${successPercentage}%`, width: `${failurePercentage}%` }}
303-
button={<div className="h-full w-full" />}
300+
<motion.div
301+
className="absolute top-0 h-full w-full bg-charcoal-550"
302+
initial={{ width: `${failurePercentage}%`, left: `${successPercentage}%` }}
303+
animate={{ width: `${failurePercentage}%`, left: `${successPercentage}%` }}
304+
transition={{ duration: 0.3, ease: "easeOut" }}
304305
/>
305306
</div>
306307
<div className="flex items-center gap-2">

0 commit comments

Comments
 (0)