Skip to content

Commit 33fd08e

Browse files
committed
fix: button redirect target for link
1 parent 45f7787 commit 33fd08e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

client/src/components/ui/Button/Button.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ const Button = <T extends ButtonProps>(
106106
}
107107
}
108108
}
109-
target={target}
109+
/**
110+
* When it's a Link, don't set.
111+
* Otherwise, target set explicitly -- it was not spread in filteredProps.
112+
*/
113+
target={to ? undefined : target}
110114
// eslint-disable-next-line react/button-has-type
111115
{...filteredProps}
112116
>

client/src/routes/RootRoutes/RootRoutes.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ const RootRoutes = (): ReactElement => {
6565
<>
6666
{!(isPatronMode || isProjectAdminMode) && (
6767
<Route
68-
element={isDesktop ? <Navigate to={lastSeenPathRef.current} /> : <AllocationView />}
68+
element={
69+
isDesktop ? <Navigate to={lastSeenPathRef.current} /> : <AllocationView />
70+
}
6971
path={`${ROOT_ROUTES.allocation.relative}/*`}
7072
/>
7173
)}

0 commit comments

Comments
 (0)