Skip to content

Commit 6deed23

Browse files
committed
Nicer styling/layout for the last used badge
1 parent 1bcfd32 commit 6deed23

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

apps/webapp/app/routes/login._index/route.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { EnvelopeIcon } from "@heroicons/react/20/solid";
22
import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node";
33
import { Form } from "@remix-run/react";
44
import { GitHubLightIcon } from "@trigger.dev/companyicons";
5+
import { motion, useReducedMotion } from "framer-motion";
56
import { redirect, typedjson, useTypedLoaderData } from "remix-typedjson";
67
import { LoginPageLayout } from "~/components/LoginPageLayout";
78
import { Button, LinkButton } from "~/components/primitives/Buttons";
@@ -41,10 +42,22 @@ function GoogleIcon({ className }: { className?: string }) {
4142
}
4243

4344
function LastUsedBadge() {
45+
const shouldReduceMotion = useReducedMotion();
46+
4447
return (
45-
<span className="absolute -right-2 -top-2.5 z-10 rounded border border-charcoal-750 bg-charcoal-800 px-2 py-1 text-[11px] font-medium text-blue-400">
46-
Last used
47-
</span>
48+
<div className="absolute -right-[4.6rem] top-1/2 z-10 -translate-y-1/2 shadow-md">
49+
<motion.div
50+
className="relative inline-flex flex-col items-center rounded border border-charcoal-700 bg-charcoal-800 px-2 py-1 text-center text-[10px] font-medium uppercase text-blue-500"
51+
initial={shouldReduceMotion ? undefined : { opacity: 0, x: 4 }}
52+
animate={shouldReduceMotion ? undefined : { opacity: 1, x: 0 }}
53+
transition={shouldReduceMotion ? undefined : { duration: 0.8, ease: "easeOut" }}
54+
>
55+
<span className="pointer-events-none absolute left-0 top-1/2 -translate-x-1/2 -translate-y-1/2">
56+
<span className="block h-2 w-2 rotate-45 border-b border-l border-charcoal-700 bg-charcoal-800" />
57+
</span>
58+
Last used
59+
</motion.div>
60+
</div>
4861
);
4962
}
5063

0 commit comments

Comments
 (0)