Skip to content

Commit 75163ec

Browse files
committed
Dashboard: Fix team links in header on pages outside /team layout (#6981)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR modifies the `href` attribute of a `Link` component in the `TeamSelectionUI.tsx` file to ensure that the URL is correctly updated when navigating between teams, specifically when on the `/team` page. ### Detailed summary - Updated the `href` logic in the `Link` component. - Added a condition to check if `pathname` starts with `/team`. - Changed the replacement logic to include the `/team/` prefix for both `currentTeam` and `team`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 106ca3c commit 75163ec

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

apps/dashboard/src/app/(app)/team/components/TeamHeader/TeamSelectionUI.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,13 @@ export function TeamSelectionUI(props: {
9393
>
9494
<Link
9595
href={
96-
currentTeam && !props.isOnProjectPage
97-
? pathname.replace(currentTeam.slug, team.slug)
96+
currentTeam &&
97+
!props.isOnProjectPage &&
98+
pathname.startsWith("/team")
99+
? pathname.replace(
100+
`/team/${currentTeam.slug}`,
101+
`/team/${team.slug}`,
102+
)
98103
: `/team/${team.slug}`
99104
}
100105
>

0 commit comments

Comments
 (0)