From 5b80e7cf988475fcbace89c62643d42f3a58135a Mon Sep 17 00:00:00 2001 From: Jesse Pinho Date: Mon, 27 May 2024 13:15:36 -0700 Subject: [PATCH] Make the segmented picker animated (#1167) * Make the segmented picker animated * Add comment * Extract a helpfully named component * Hide the duplicate text * Fix tests * Add changeset * Set short duration for motion transitions * Animate top tabs --- .changeset/unlucky-birds-kneel.md | 5 ++ .../src/components/dashboard/layout.tsx | 4 +- .../src/components/header/navbar.tsx | 35 ++++++++--- apps/minifront/src/components/layout.tsx | 5 +- apps/minifront/src/components/send/layout.tsx | 2 +- apps/minifront/src/components/shared/tabs.tsx | 42 +++++-------- .../src/components/tx-details/tx-viewer.tsx | 32 ++++++---- .../components/ui/segmented-picker.test.tsx | 17 ++++-- .../ui/components/ui/segmented-picker.tsx | 60 +++++++++++++++++-- 9 files changed, 142 insertions(+), 60 deletions(-) create mode 100644 .changeset/unlucky-birds-kneel.md diff --git a/.changeset/unlucky-birds-kneel.md b/.changeset/unlucky-birds-kneel.md new file mode 100644 index 0000000000..cd53f0b916 --- /dev/null +++ b/.changeset/unlucky-birds-kneel.md @@ -0,0 +1,5 @@ +--- +'@penumbra-zone/ui': minor +--- + +Add animations to SegmentedPicker diff --git a/apps/minifront/src/components/dashboard/layout.tsx b/apps/minifront/src/components/dashboard/layout.tsx index 63bbfbac54..75be0a7667 100644 --- a/apps/minifront/src/components/dashboard/layout.tsx +++ b/apps/minifront/src/components/dashboard/layout.tsx @@ -17,7 +17,9 @@ export const DashboardLayout = () => { gradient className='order-2 flex flex-1 flex-col p-5 md:p-4 lg:order-1 lg:col-span-2 lg:row-span-2 xl:p-5' > - +
+ +
( + +); + +const isActive = (link: HeaderLink, pathname: HeaderLink['href']) => + link.href === pathname || link.subLinks?.includes(pathname); export const Navbar = () => { const pathname = usePagePath(); + const layoutId = useId(); return (