mirror of
https://github.com/grafana/grafana.git
synced 2026-08-08 20:28:14 -05:00
ReturnToPrevious: Add guidelines to returnToPrevious hook (#83219)
This commit is contained in:
@@ -6,6 +6,11 @@ export const setReturnToPreviousHook = (hook: ReturnToPreviousHook) => {
|
||||
rtpHook = hook;
|
||||
};
|
||||
|
||||
/**
|
||||
* Guidelines:
|
||||
* - Only use the ‘Return to previous’ functionality when the user is sent to another context, such as from Alerting to a dashboard.
|
||||
* - Specify a button title that identifies the page to return to in the most understandable way. Do not use text such as ‘Back to the previous page’. Be specific.
|
||||
*/
|
||||
export const useReturnToPrevious: ReturnToPreviousHook = () => {
|
||||
if (!rtpHook) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
|
||||
Reference in New Issue
Block a user