From e04bccace5dde13927dfab029abb58ad6485a50e Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Fri, 2 Feb 2024 16:17:07 +0900 Subject: [PATCH] feat: add cr plausible context --- .../changeRequest/ChangeRequestContext.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 frontend/src/component/changeRequest/ChangeRequestContext.tsx diff --git a/frontend/src/component/changeRequest/ChangeRequestContext.tsx b/frontend/src/component/changeRequest/ChangeRequestContext.tsx new file mode 100644 index 0000000000..2611acc5c9 --- /dev/null +++ b/frontend/src/component/changeRequest/ChangeRequestContext.tsx @@ -0,0 +1,15 @@ +import { createContext, useContext } from 'react'; + +const defaultContext = { + willOverwriteStrategyChanges: false, + registerWillOverwriteStrategyChanges: () => {}, +}; + +const ChangeRequestPlausibleContext = createContext(defaultContext); + +export const ChangeRequestPlausibleProvider = + ChangeRequestPlausibleContext.Provider; + +export const useChangeRequestPlausibleContext = (): typeof defaultContext => { + return useContext(ChangeRequestPlausibleContext); +};