-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: hidden settings menu affects settings layout (#7769)
This PR fixes #6746 --------- Co-authored-by: Charles Bochet <[email protected]>
- Loading branch information
1 parent
4407b1a
commit 5e2df81
Showing
7 changed files
with
56 additions
and
37 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
19 changes: 0 additions & 19 deletions
19
packages/twenty-front/src/modules/app/effect-components/GotoHotkeysEffect.tsx
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
packages/twenty-front/src/modules/app/effect-components/GotoHotkeysEffectsProvider.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,37 @@ | ||
import { GoToHotkeyItemEffect } from '@/app/effect-components/GoToHotkeyItemEffect'; | ||
import { useNonSystemActiveObjectMetadataItems } from '@/object-metadata/hooks/useNonSystemActiveObjectMetadataItems'; | ||
import { isNavigationDrawerExpandedState } from '@/ui/navigation/states/isNavigationDrawerExpanded'; | ||
import { navigationDrawerExpandedMemorizedState } from '@/ui/navigation/states/navigationDrawerExpandedMemorizedState'; | ||
import { navigationMemorizedUrlState } from '@/ui/navigation/states/navigationMemorizedUrlState'; | ||
import { useGoToHotkeys } from '@/ui/utilities/hotkey/hooks/useGoToHotkeys'; | ||
import { useLocation } from 'react-router-dom'; | ||
import { useRecoilCallback } from 'recoil'; | ||
|
||
export const GotoHotkeysEffectsProvider = () => { | ||
const { nonSystemActiveObjectMetadataItems } = | ||
useNonSystemActiveObjectMetadataItems(); | ||
|
||
const location = useLocation(); | ||
|
||
useGoToHotkeys({ | ||
key: 's', | ||
location: '/settings/profile', | ||
preNavigateFunction: useRecoilCallback( | ||
({ set }) => | ||
() => { | ||
set(isNavigationDrawerExpandedState, true); | ||
set(navigationDrawerExpandedMemorizedState, true); | ||
set(navigationMemorizedUrlState, location.pathname + location.search); | ||
}, | ||
[location.pathname, location.search], | ||
), | ||
}); | ||
|
||
return nonSystemActiveObjectMetadataItems.map((objectMetadataItem) => ( | ||
<GoToHotkeyItemEffect | ||
key={`go-to-hokey-item-${objectMetadataItem.id}`} | ||
hotkey={objectMetadataItem.namePlural[0]} | ||
pathToNavigateTo={`/objects/${objectMetadataItem.namePlural}`} | ||
/> | ||
)); | ||
}; |
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