Skip to content

Commit cf841e5

Browse files
committed
fix(platform): preserve explicit back-link props
1 parent 1626e5c commit cf841e5

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

‎apps/sim/platform/app/(shell)/integrations/_components/integrations-page/integrations-page.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface IntegrationsPageProps {
1414
export function IntegrationsPage({ back, children }: IntegrationsPageProps) {
1515
return (
1616
<DirectoryPage>
17-
{back && <DirectoryBack {...back} />}
17+
{back && <DirectoryBack href={back.href} label={back.label} onNavigate={back.onNavigate} />}
1818
{children}
1919
</DirectoryPage>
2020
)

‎apps/sim/platform/design-system/components/button/button.tsx‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ export function Chip({
144144
status,
145145
replaceActionOnTouch,
146146
}: ChipProps) {
147-
const external = href && isAbsoluteHref(href)
148-
const LinkElement = external ? 'a' : Link
149147
return (
150148
<ControlRow
151149
label={children}
@@ -155,11 +153,17 @@ export function Chip({
155153
replaceActionOnTouch={replaceActionOnTouch}
156154
render={
157155
href ? (
158-
<LinkElement
159-
href={href}
160-
{...(!external ? { onNavigate } : {})}
161-
aria-current={selected ? 'page' : undefined}
162-
/>
156+
isAbsoluteHref(href) ? (
157+
<a href={href} aria-current={selected ? 'page' : undefined}>
158+
{children}
159+
</a>
160+
) : (
161+
<Link
162+
href={href}
163+
onNavigate={onNavigate}
164+
aria-current={selected ? 'page' : undefined}
165+
/>
166+
)
163167
) : (
164168
<button type='button' aria-pressed={selected} onClick={onClick} />
165169
)

0 commit comments

Comments
 (0)