mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 16:22:59 +10:00
🚀 release v3.0.0
This commit is contained in:
17
client/wrappers/HotkeysWrapper.tsx
Normal file
17
client/wrappers/HotkeysWrapper.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import { useHotkeys } from 'react-hotkeys-hook';
|
||||
|
||||
import { toggleSidebar } from '@/store/build/buildSlice';
|
||||
import { useAppDispatch } from '@/store/hooks';
|
||||
|
||||
const HotkeysWrapper: React.FC = ({ children }) => {
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
useHotkeys('ctrl+/, cmd+/', () => {
|
||||
dispatch(toggleSidebar({ sidebar: 'left' }));
|
||||
dispatch(toggleSidebar({ sidebar: 'right' }));
|
||||
});
|
||||
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
export default HotkeysWrapper;
|
||||
Reference in New Issue
Block a user