Skip to content

Commit 8d782db

Browse files
committed
feat(frontend): add OnboardingTour.Target to LinksGroup component
1 parent feb0a55 commit 8d782db

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

apps/frontend/app/routes/_dashboard.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ import {
149149
import { colorSchemeCookie } from "~/lib/utilities.server";
150150
import classes from "~/styles/dashboard.module.css";
151151
import type { Route } from "./+types/_dashboard";
152+
import { OnboardingTour } from "@gfazioli/mantine-onboarding-tour";
152153

153154
const discordLink = "https://discord.gg/D9XTg2a7R8";
154155
const desktopSidebarCollapsedCookie = "DesktopSidebarCollapsed";
@@ -837,11 +838,10 @@ const LinksGroup = ({
837838
</NavLink>
838839
));
839840

840-
return (
841-
<>
841+
const component = (
842+
<Box>
842843
<UnstyledButton<typeof Link>
843844
className={classes.control}
844-
data-onboarding-tour-id={tourStepId}
845845
component={!hasLinks ? Link : undefined}
846846
// biome-ignore lint/suspicious/noExplicitAny: required here
847847
to={!hasLinks ? href : (undefined as any)}
@@ -876,8 +876,15 @@ const LinksGroup = ({
876876
</Group>
877877
</UnstyledButton>
878878
{hasLinks ? <Collapse in={opened}>{items}</Collapse> : null}
879-
</>
879+
</Box>
880880
);
881+
882+
if (tourStepId)
883+
return (
884+
<OnboardingTour.Target id={tourStepId}>{component}</OnboardingTour.Target>
885+
);
886+
887+
return component;
881888
};
882889

883890
const Footer = () => {

0 commit comments

Comments
 (0)