-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shortcuts at bottom of sidebar (#4705)
* Add shortcuts at bottom of sidebar * Navigator context * Style sidebar * Remove menu back to cloud tests * Add changeset * Add condtion to back to cloud btn * Style improvents, show cmd base on os * Show playground on ctrl + ' * Test sidebar go to cloud and shortcuts * Update changeset * Improve naming * Rename Navigator to NavigatorSearch * Move context outside AppLayout * Memoize shortcuts * Update tests * Fix typo * Refactor dev panel
- Loading branch information
Showing
50 changed files
with
750 additions
and
331 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"saleor-dashboard": minor | ||
--- | ||
|
||
Introduce menu items with sortcuts for GraphQL playground and search actions in sidebar. | ||
Move "Go to Saleor Cloud" button at bottom of sidebar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
import { useEffect } from "react"; | ||
|
||
type DevModeKeyTriggerCallback = ( | ||
err: Error | null, | ||
{ shift }: { shift: boolean }, | ||
) => void; | ||
type DevModeKeyTriggerCallback = ({ shift }: { shift: boolean }) => void; | ||
|
||
export const useDevModeKeyTrigger = (callback: DevModeKeyTriggerCallback) => { | ||
export const useDevModeKeyTrigger = ( | ||
callbackHandler: DevModeKeyTriggerCallback, | ||
) => { | ||
useEffect(() => { | ||
const handler = (event: KeyboardEvent) => { | ||
if (event.shiftKey && event.metaKey && event.code === "Quote") { | ||
callback(null, { shift: true }); | ||
callbackHandler({ shift: true }); | ||
} else if (event.metaKey && event.code === "Quote") { | ||
callback(null, { shift: false }); | ||
callbackHandler({ shift: false }); | ||
} else if (event.ctrlKey && event.code === "Quote") { | ||
callbackHandler({ shift: false }); | ||
} | ||
}; | ||
|
||
document.addEventListener("keydown", handler); | ||
return () => document.removeEventListener("keydown", handler); | ||
}, [callback]); | ||
}, [callbackHandler]); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.