Skip to content

Commit cfedc36

Browse files
authored
Fix site overview card links when going into stepper (#109395)
1 parent be031b2 commit cfedc36

File tree

1 file changed

+19
-2
lines changed
  • client/dashboard/components/overview-card

1 file changed

+19
-2
lines changed

client/dashboard/components/overview-card/index.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,18 @@ export default function OverviewCard( {
9191
return <>&nbsp;</>;
9292
};
9393

94-
const isRelativeLink = link && ( isRelativeUrl( link ) || isOnboardingUrl( link ) );
94+
// Stepper/onboarding flows are not considered relative links because they can't be loaded by TanStack Router.
95+
const isOnboarding = link && isOnboardingUrl( link );
96+
const isRelativeLink = link && isRelativeUrl( link ) && ! isOnboarding;
9597

9698
let relativeLink: string | undefined = undefined;
99+
let onboardingLink: string | undefined = undefined;
97100
let externalLink: string | undefined = undefined;
98101

99102
if ( externalLinkProp ) {
100103
externalLink = externalLinkProp;
104+
} else if ( isOnboarding ) {
105+
onboardingLink = link;
101106
} else if ( isRelativeLink ) {
102107
relativeLink = link;
103108
} else {
@@ -125,7 +130,7 @@ export default function OverviewCard( {
125130
{ title }
126131
</Text>
127132
</HStack>
128-
{ relativeLink && ! progress && (
133+
{ ( relativeLink || onboardingLink ) && ! progress && (
129134
<Icon
130135
className="dashboard-overview-card__link-icon"
131136
icon={ isRTL() ? chevronLeft : chevronRight }
@@ -209,6 +214,18 @@ export default function OverviewCard( {
209214
);
210215
}
211216

217+
if ( onboardingLink ) {
218+
return (
219+
<a
220+
href={ onboardingLink }
221+
className="dashboard-overview-card__link"
222+
onClick={ handleClick }
223+
>
224+
{ topContent }
225+
</a>
226+
);
227+
}
228+
212229
if ( externalLink ) {
213230
return (
214231
<a

0 commit comments

Comments
 (0)