From f3d8b4474302a00fd923581046b0f5828a4c5976 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 12 Apr 2022 20:55:34 +0200 Subject: copyright headers --- .../src/context/devContext.ts | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-webextension') diff --git a/packages/taler-wallet-webextension/src/context/devContext.ts b/packages/taler-wallet-webextension/src/context/devContext.ts index edd52c11d..1ce483d8d 100644 --- a/packages/taler-wallet-webextension/src/context/devContext.ts +++ b/packages/taler-wallet-webextension/src/context/devContext.ts @@ -34,14 +34,31 @@ const Context = createContext({ export const useDevContext = (): Type => useContext(Context); -export const DevContextProviderForTesting = ({ value, children }: { value: boolean, children: any }): VNode => { - return h(Context.Provider, { value: { devMode: value, toggleDevMode: () => { null } }, children }); +export const DevContextProviderForTesting = ({ + value, + children, +}: { + value: boolean; + children: any; +}): VNode => { + return h(Context.Provider, { + value: { + devMode: value, + toggleDevMode: () => { + null; + }, + }, + children, + }); }; export const DevContextProvider = ({ children }: { children: any }): VNode => { const [value, setter] = useLocalStorage("devMode"); const devMode = value === "true"; const toggleDevMode = (): void => setter((v) => (!v ? "true" : undefined)); - children = children.length === 1 && typeof children === "function" ? children({ devMode }) : children; + children = + children.length === 1 && typeof children === "function" + ? children({ devMode }) + : children; return h(Context.Provider, { value: { devMode, toggleDevMode }, children }); }; -- cgit v1.2.3