Skip to content

Commit 6c54693

Browse files
authored
Improved v3 feedback button (#959)
* Removed feedback button from PageHeader * Show a different feedback button in the side menu for v3 projects * Fixed issue with button wrapping on smaller width browser
1 parent 08e4fc0 commit 6c54693

File tree

3 files changed

+37
-40
lines changed

3 files changed

+37
-40
lines changed

apps/webapp/app/components/Feedback.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function Feedback({ button, defaultValue = "bug" }: FeedbackProps) {
117117
<Paragraph className="mb-4">
118118
If you're having trouble, check out our documentation or the Trigger.dev Status page.
119119
</Paragraph>
120-
<div className="flex gap-x-2">
120+
<div className="flex flex-wrap gap-2">
121121
<LinkButton to={docsPath("")} variant="tertiary/medium" LeadingIcon={BookOpenIcon}>
122122
Docs
123123
</LinkButton>

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

+33-17
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { UserGroupIcon, UserPlusIcon } from "@heroicons/react/24/solid";
1414
import { useNavigation } from "@remix-run/react";
1515
import { DiscordIcon, SlackIcon } from "@trigger.dev/companyicons";
1616
import { Fragment, useEffect, useRef, useState } from "react";
17+
import { TaskIcon } from "~/assets/icons/TaskIcon";
1718
import { useFeatures } from "~/hooks/useFeatures";
1819
import { MatchedOrganization } from "~/hooks/useOrganizations";
1920
import { MatchedProject } from "~/hooks/useProject";
@@ -54,6 +55,7 @@ import { LogoIcon } from "../LogoIcon";
5455
import { StepContentContainer } from "../StepContentContainer";
5556
import { UserProfilePhoto } from "../UserProfilePhoto";
5657
import { FreePlanUsage } from "../billing/FreePlanUsage";
58+
import { Badge } from "../primitives/Badge";
5759
import { Button } from "../primitives/Buttons";
5860
import { ClipboardField } from "../primitives/ClipboardField";
5961
import { Dialog, DialogContent, DialogHeader, DialogTrigger } from "../primitives/Dialog";
@@ -70,8 +72,6 @@ import {
7072
import { StepNumber } from "../primitives/StepNumber";
7173
import { SideMenuHeader } from "./SideMenuHeader";
7274
import { MenuCount, SideMenuItem } from "./SideMenuItem";
73-
import { Badge } from "../primitives/Badge";
74-
import { TaskIcon } from "~/assets/icons/TaskIcon";
7575

7676
type SideMenuUser = Pick<User, "email" | "admin"> & { isImpersonating: boolean };
7777
type SideMenuProject = Pick<
@@ -269,28 +269,44 @@ export function SideMenu({ user, project, organization, organizations }: SideMen
269269
target="_blank"
270270
/>
271271
)}
272-
273272
<SideMenuItem
274273
name="Changelog"
275274
icon="star"
276275
to="https://trigger.dev/changelog"
277276
data-action="changelog"
278277
target="_blank"
279278
/>
280-
281-
<Feedback
282-
button={
283-
<Button
284-
variant="small-menu-item"
285-
LeadingIcon="log"
286-
data-action="help & feedback"
287-
fullWidth
288-
textAlignLeft
289-
>
290-
Help & Feedback
291-
</Button>
292-
}
293-
/>
279+
{project.version === "V2" ? (
280+
<Feedback
281+
button={
282+
<Button
283+
variant="small-menu-item"
284+
LeadingIcon="log"
285+
data-action="help & feedback"
286+
fullWidth
287+
textAlignLeft
288+
>
289+
Help & Feedback
290+
</Button>
291+
}
292+
/>
293+
) : (
294+
<Feedback
295+
defaultValue="developer preview"
296+
button={
297+
<Button
298+
variant="small-menu-item"
299+
LeadingIcon="log"
300+
leadingIconClassName="text-primary"
301+
data-action="help & feedback"
302+
fullWidth
303+
textAlignLeft
304+
>
305+
<span className="text-primary">Give feedback on v3</span>
306+
</Button>
307+
}
308+
/>
309+
)}
294310
{currentPlan && !currentPlan.subscription?.isPaying && currentPlan.usage.runCountCap && (
295311
<FreePlanUsage
296312
to={organizationBillingPath(organization)}

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

+3-22
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import { ArrowUpRightIcon } from "@heroicons/react/20/solid";
22
import { Link, useNavigation } from "@remix-run/react";
33
import { useOptionalOrganization } from "~/hooks/useOrganizations";
4+
import { useOptionalProject } from "~/hooks/useProject";
45
import { cn } from "~/utils/cn";
56
import { plansPath } from "~/utils/pathBuilder";
67
import { UpgradePrompt, useShowUpgradePrompt } from "../billing/UpgradePrompt";
78
import { BreadcrumbIcon } from "./BreadcrumbIcon";
8-
import { Button, LinkButton } from "./Buttons";
9+
import { LinkButton } from "./Buttons";
910
import { Header2 } from "./Headers";
1011
import { LoadingBarDivider } from "./LoadingBarDivider";
1112
import { NamedIcon } from "./NamedIcon";
1213
import { Paragraph } from "./Paragraph";
1314
import { Tabs, TabsProps } from "./Tabs";
14-
import { useOptionalProject } from "~/hooks/useProject";
15-
import { Feedback } from "../Feedback";
1615

1716
type WithChildren = {
1817
children: React.ReactNode;
@@ -24,29 +23,11 @@ export function NavBar({ children }: WithChildren) {
2423
const navigation = useNavigation();
2524
const isLoading = navigation.state === "loading" || navigation.state === "submitting";
2625
const project = useOptionalProject();
27-
const isV3Project = project?.version === "V3";
2826

2927
return (
3028
<div>
3129
<div className="grid h-10 w-full grid-rows-[auto_1px] bg-background-bright">
32-
<div className="flex w-full items-center justify-between pl-3 pr-1">
33-
{children}
34-
{isV3Project && (
35-
<Feedback
36-
defaultValue="developer preview"
37-
button={
38-
<Button
39-
variant="secondary/small"
40-
LeadingIcon="log"
41-
leadingIconClassName="text-primary"
42-
data-action="help & feedback"
43-
>
44-
Developer preview feedback
45-
</Button>
46-
}
47-
/>
48-
)}
49-
</div>
30+
<div className="flex w-full items-center justify-between pl-3 pr-1">{children}</div>
5031
<LoadingBarDivider isLoading={isLoading} />
5132
</div>
5233
{showUpgradePrompt.shouldShow && organization && (

0 commit comments

Comments
 (0)