-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change share brain button logic (#1078)
- Loading branch information
1 parent
a43890c
commit 08a1df0
Showing
4 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
frontend/app/brains-management/[brainId]/components/BrainManagementTabs/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export type BrainManagementTab = "settings" | "people" | "knowledge"; | ||
export const brainManagementTabs = ["settings", "people", "knowledge"] as const; | ||
|
||
export type BrainManagementTab = (typeof brainManagementTabs)[number]; |
8 changes: 8 additions & 0 deletions
8
...nd/app/brains-management/[brainId]/components/BrainManagementTabs/utils/getTargetedTab.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { BrainManagementTab, brainManagementTabs } from "../types"; | ||
|
||
export const getTargetedTab = (): BrainManagementTab | undefined => { | ||
const targetedTab = window.location.hash.split("#")[1]; | ||
if (brainManagementTabs.includes(targetedTab as BrainManagementTab)) { | ||
return targetedTab as BrainManagementTab; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters