-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data settings new layout - anchor navigation (#8334)
Follow-up of #7979 Navigation between settings and fields tabs is now reflected in URL. <img width="1106" alt="Capture d’écran 2024-11-07 à 18 38 57" src="https://github.com/user-attachments/assets/24b153ef-9e68-4aa2-8e3a-6bf70834c5ad"> --------- Co-authored-by: gitstart-twenty <[email protected]> Co-authored-by: gitstart-twenty <[email protected]> Co-authored-by: Weiko <[email protected]> Co-authored-by: Charles Bochet <[email protected]>
- Loading branch information
1 parent
9d6a850
commit bec4da4
Showing
13 changed files
with
143 additions
and
74 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
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,5 +1,4 @@ | ||
name: CI Website | ||
timeout-minutes: 10 | ||
on: | ||
push: | ||
branches: | ||
|
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
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
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
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
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
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
33 changes: 33 additions & 0 deletions
33
packages/twenty-front/src/modules/ui/layout/tab/components/TabListFromUrlOptionalEffect.tsx
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,33 @@ | ||
import { useTabList } from '@/ui/layout/tab/hooks/useTabList'; | ||
import { useEffect } from 'react'; | ||
import { useLocation } from 'react-router-dom'; | ||
import { useRecoilValue } from 'recoil'; | ||
|
||
type TabListFromUrlOptionalEffectProps = { | ||
componentInstanceId: string; | ||
tabListIds: string[]; | ||
}; | ||
|
||
export const TabListFromUrlOptionalEffect = ({ | ||
componentInstanceId, | ||
tabListIds, | ||
}: TabListFromUrlOptionalEffectProps) => { | ||
const location = useLocation(); | ||
const { activeTabIdState } = useTabList(componentInstanceId); | ||
const { setActiveTabId } = useTabList(componentInstanceId); | ||
|
||
const hash = location.hash.replace('#', ''); | ||
const activeTabId = useRecoilValue(activeTabIdState); | ||
|
||
useEffect(() => { | ||
if (hash === activeTabId) { | ||
return; | ||
} | ||
|
||
if (tabListIds.includes(hash)) { | ||
setActiveTabId(hash); | ||
} | ||
}, [hash, activeTabId, setActiveTabId, tabListIds]); | ||
|
||
return <></>; | ||
}; |
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
Oops, something went wrong.