From a6e85f00b2821529a6892f40b0fe105763e72946 Mon Sep 17 00:00:00 2001 From: James Ritchie Date: Tue, 18 Mar 2025 19:04:51 +0000 Subject: [PATCH] Side menu and Org dropdown improvements (#1801) * Organize imports * Removes animation on the dropdown menu icon * Improves Settings and Usage button states * Side menu sections animate with easeInOut * Incorporates docs button into the text and adds title to the clipboard field * Icons look better as the small variant * Improved the typography layout of the org name and small links * Made the divide line show when the side menu scrolls * Made the impersonating icon amber so it stands out more * Adds an optional amber border to the org dropdown --- .../app/components/ImpersonationBanner.tsx | 6 +- apps/webapp/app/components/SetupCommands.tsx | 69 +++++++++++------- .../navigation/EnvironmentSelector.tsx | 7 +- .../app/components/navigation/SideMenu.tsx | 72 +++++++++---------- .../components/navigation/SideMenuSection.tsx | 8 +-- .../app/components/primitives/Avatar.tsx | 3 +- .../app/components/primitives/Popover.tsx | 7 +- 7 files changed, 88 insertions(+), 84 deletions(-) diff --git a/apps/webapp/app/components/ImpersonationBanner.tsx b/apps/webapp/app/components/ImpersonationBanner.tsx index d4486fc96..367f31dfd 100644 --- a/apps/webapp/app/components/ImpersonationBanner.tsx +++ b/apps/webapp/app/components/ImpersonationBanner.tsx @@ -1,7 +1,6 @@ -import { Form } from "@remix-run/react"; -import { Paragraph } from "./primitives/Paragraph"; -import { Button } from "./primitives/Buttons"; import { UserMinusIcon } from "@heroicons/react/20/solid"; +import { Form } from "@remix-run/react"; +import { Button } from "./primitives/Buttons"; export function ImpersonationBanner() { return ( @@ -13,6 +12,7 @@ export function ImpersonationBanner() { LeadingIcon={UserMinusIcon} fullWidth textAlignLeft + className="text-amber-400" > Stop impersonating diff --git a/apps/webapp/app/components/SetupCommands.tsx b/apps/webapp/app/components/SetupCommands.tsx index fc376480a..c711e6c3d 100644 --- a/apps/webapp/app/components/SetupCommands.tsx +++ b/apps/webapp/app/components/SetupCommands.tsx @@ -10,6 +10,7 @@ import { } from "./primitives/ClientTabs"; import { ClipboardField } from "./primitives/ClipboardField"; import { Paragraph } from "./primitives/Paragraph"; +import { Header3 } from "./primitives/Headers"; type PackageManagerContextType = { activePackageManager: string; @@ -61,7 +62,12 @@ function getApiUrlArg() { return apiUrl ? `-a ${apiUrl}` : undefined; } -export function InitCommandV3() { +// Add title prop to the component interfaces +type TabsProps = { + title?: string; +}; + +export function InitCommandV3({ title }: TabsProps) { const project = useProject(); const projectRef = project.externalRef; const apiUrlArg = getApiUrlArg(); @@ -77,14 +83,17 @@ export function InitCommandV3() { value={activePackageManager} onValueChange={setActivePackageManager} > - - npm - pnpm - yarn - +
+ {title && {title}} + + npm + pnpm + yarn + +
- - npm - pnpm - yarn - +
+ {title && {title}} + + npm + pnpm + yarn + +
- - npm - pnpm - yarn - +
+ {title && {title}} + + npm + pnpm + yarn + +
& { isImpersonating: boolean }; export type SideMenuProject = Pick< @@ -144,8 +139,8 @@ export function SideMenu({ >
@@ -320,25 +318,26 @@ function ProjectSelector({ >
-
+
- {organization.title} -
+ {organization.title} +
{plan && ( - - - {plan} - - - )} - {simplur`${organization.membersCount} member[|s]`} - + className="text-xs" + to={v3BillingPath(organization)} + > + {plan} + + )} + {simplur`${organization.membersCount} member[|s]`}
@@ -348,6 +347,7 @@ function ProjectSelector({ to={organizationSettingsPath(organization)} fullWidth iconSpacing="gap-1.5" + className="group-hover/button:border-charcoal-500" > Settings @@ -357,6 +357,7 @@ function ProjectSelector({ to={v3UsagePath(organization)} fullWidth iconSpacing="gap-1.5" + className="group-hover/button:border-charcoal-500" > Usage @@ -550,9 +551,7 @@ export function DevConnection() {
- {isConnected - ? "Your dev server is connected to Trigger.dev" - : "Your dev server is not connected to Trigger.dev"} + {isConnected ? "Your dev server is connected" : "Your dev server is not connected"}
@@ -571,20 +570,17 @@ export function DevConnection() { {isConnected ? null : (
- + - Run this CLI `dev` command to connect to the Trigger.dev servers to start developing - locally. Keep it running while you develop to stay connected. + Run this CLI dev command to connect + to the Trigger.dev servers to start developing locally. Keep it running while you + develop to stay connected. Learn more in the{" "} + CLI docs.
)}
- - - CLI docs - - ); diff --git a/apps/webapp/app/components/navigation/SideMenuSection.tsx b/apps/webapp/app/components/navigation/SideMenuSection.tsx index e6d4e4759..170451db4 100644 --- a/apps/webapp/app/components/navigation/SideMenuSection.tsx +++ b/apps/webapp/app/components/navigation/SideMenuSection.tsx @@ -50,13 +50,13 @@ export function SideMenuSection({ expanded: { height: "auto", transition: { - height: { duration: 0.3, ease: "easeOut" }, + height: { duration: 0.3, ease: "easeInOut" }, }, }, collapsed: { height: 0, transition: { - height: { duration: 0.2, ease: "easeIn" }, + height: { duration: 0.2, ease: "easeInOut" }, }, }, }} @@ -67,12 +67,12 @@ export function SideMenuSection({ expanded: { translateY: 0, opacity: 1, - transition: { duration: 0.3, ease: "easeOut" }, + transition: { duration: 0.3, ease: "easeInOut" }, }, collapsed: { translateY: "-100%", opacity: 0, - transition: { duration: 0.2, ease: "easeIn" }, + transition: { duration: 0.2, ease: "easeInOut" }, }, }} > diff --git a/apps/webapp/app/components/primitives/Avatar.tsx b/apps/webapp/app/components/primitives/Avatar.tsx index 3c62c0900..33998885f 100644 --- a/apps/webapp/app/components/primitives/Avatar.tsx +++ b/apps/webapp/app/components/primitives/Avatar.tsx @@ -1,12 +1,11 @@ import { BuildingOffice2Icon, CodeBracketSquareIcon, - CubeIcon, FaceSmileIcon, FireIcon, RocketLaunchIcon, StarIcon, -} from "@heroicons/react/24/solid"; +} from "@heroicons/react/20/solid"; import { type Prisma } from "@trigger.dev/database"; import { useLayoutEffect, useRef, useState } from "react"; import { z } from "zod"; diff --git a/apps/webapp/app/components/primitives/Popover.tsx b/apps/webapp/app/components/primitives/Popover.tsx index 6fc0bffe6..0c84e4b90 100644 --- a/apps/webapp/app/components/primitives/Popover.tsx +++ b/apps/webapp/app/components/primitives/Popover.tsx @@ -175,12 +175,7 @@ function PopoverArrowTrigger({ > {children} - + ); }