Skip to content

Commit e5ffc3a

Browse files
authored
Added a link to the homepage from the side menu (#479)
* Added 2 new named icons * New side menu link to the homepage * Updated lock file * Removed un-used import
1 parent 363c74c commit e5ffc3a

File tree

4 files changed

+148
-35
lines changed

4 files changed

+148
-35
lines changed

apps/webapp/app/components/navigation/ProjectSideMenu.tsx

+14-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import {
1111
organizationTeamPath,
1212
projectEnvironmentsPath,
1313
projectIntegrationsPath,
14-
projectSetupPath,
1514
projectPath,
15+
projectSetupPath,
1616
projectTriggersPath,
1717
} from "~/utils/pathBuilder";
1818
import { UserProfilePhoto } from "../UserProfilePhoto";
@@ -96,7 +96,7 @@ export function ProjectSideMenu() {
9696
data-action="environments & api keys"
9797
/>
9898
</div>
99-
<div className="flex flex-col">
99+
<div className="flex flex-col gap-1">
100100
<SideMenuItem
101101
name="Team"
102102
icon="team"
@@ -118,6 +118,14 @@ export function ProjectSideMenu() {
118118
isCollapsed={isCollapsed}
119119
data-action="onboarding"
120120
/>
121+
<SideMenuItem
122+
name="Homepage"
123+
icon="external-link"
124+
to="https://trigger.dev"
125+
isCollapsed={isCollapsed}
126+
data-action="onboarding"
127+
target="_blank"
128+
/>
121129
<SideMenuItem
122130
name="Account"
123131
icon={UserProfilePhoto}
@@ -146,13 +154,15 @@ function SideMenuItem({
146154
isCollapsed,
147155
forceActive,
148156
hasWarning = false,
157+
target,
149158
}: {
150159
icon: IconNames | React.ComponentType<any>;
151160
name: string;
152161
to: string;
153162
isCollapsed: boolean;
154163
hasWarning?: boolean;
155164
forceActive?: boolean;
165+
target?: string;
156166
}) {
157167
return (
158168
<SimpleTooltip
@@ -164,13 +174,14 @@ function SideMenuItem({
164174
LeadingIcon={icon}
165175
leadingIconClassName="text-dimmed"
166176
to={to}
177+
target={target}
167178
className={({ isActive, isPending }) => {
168179
if (forceActive !== undefined) {
169180
isActive = forceActive;
170181
}
171182
return cn(
172183
"relative",
173-
isActive
184+
isActive || isPending
174185
? "bg-slate-800 text-bright group-hover:bg-slate-800"
175186
: "text-dimmed group-hover:bg-slate-850 group-hover:text-bright"
176187
);

apps/webapp/app/components/primitives/Buttons.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,13 @@ type NavLinkPropsType = Pick<NavLinkProps, "to" | "target"> &
286286
Omit<React.ComponentProps<typeof ButtonContent>, "className"> & {
287287
className?: (props: { isActive: boolean; isPending: boolean }) => string | undefined;
288288
};
289-
export const NavLinkButton = ({ to, className, ...props }: NavLinkPropsType) => {
289+
export const NavLinkButton = ({ to, className, target, ...props }: NavLinkPropsType) => {
290290
return (
291-
<NavLink to={to} className={cn("group outline-none", props.fullWidth ? "w-full" : "")}>
291+
<NavLink
292+
to={to}
293+
className={cn("group outline-none", props.fullWidth ? "w-full" : "")}
294+
target={target}
295+
>
292296
{({ isActive, isPending }) => (
293297
<ButtonContent className={className && className({ isActive, isPending })} {...props} />
294298
)}

apps/webapp/app/components/primitives/NamedIcon.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
GlobeAltIcon,
3636
HandRaisedIcon,
3737
HeartIcon,
38+
HomeIcon,
3839
KeyIcon,
3940
LightBulbIcon,
4041
ListBulletIcon,
@@ -50,6 +51,7 @@ import {
5051
UserGroupIcon,
5152
UserIcon,
5253
UserPlusIcon,
54+
WindowIcon,
5355
WrenchScrewdriverIcon,
5456
XCircleIcon,
5557
XMarkIcon,
@@ -75,6 +77,8 @@ const icons = {
7577
background: (className: string) => <CloudIcon className={cn("text-sky-400", className)} />,
7678
beaker: (className: string) => <BeakerIcon className={cn("text-purple-500", className)} />,
7779
billing: (className: string) => <CreditCardIcon className={cn("text-teal-500", className)} />,
80+
81+
browser: (className: string) => <WindowIcon className={cn("text-dimmed", className)} />,
7882
calendar: (className: string) => (
7983
<CalendarDaysIcon className={cn("text-purple-500", className)} />
8084
),
@@ -111,6 +115,7 @@ const icons = {
111115
<HandRaisedIcon className={cn("text-amber-400", className)} />
112116
),
113117
heart: (className: string) => <HeartIcon className={cn("text-rose-500", className)} />,
118+
house: (className: string) => <HomeIcon className={cn("text-dimmed", className)} />,
114119
id: (className: string) => <FingerPrintIcon className={cn("text-rose-200", className)} />,
115120
inactive: (className: string) => <XCircleIcon className={cn("text-rose-500", className)} />,
116121
info: (className: string) => <InformationCircleIcon className={cn("text-blue-500", className)} />,

0 commit comments

Comments
 (0)