From e80ef22f0d78c8aa58d2a4a2f3a248921db94c86 Mon Sep 17 00:00:00 2001 From: dominik-zeglen Date: Tue, 23 Jun 2020 14:31:27 +0200 Subject: [PATCH] Add context to project root --- src/hooks/useBackgroundTask.ts | 6 ++++++ src/index.tsx | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 src/hooks/useBackgroundTask.ts diff --git a/src/hooks/useBackgroundTask.ts b/src/hooks/useBackgroundTask.ts new file mode 100644 index 000000000..eb477706f --- /dev/null +++ b/src/hooks/useBackgroundTask.ts @@ -0,0 +1,6 @@ +import BackgroundTasksContext from "@saleor/containers/BackgroundTasks/context"; +import { useContext } from "react"; + +const useBackgroundTask = useContext(BackgroundTasksContext); + +export default useBackgroundTask; diff --git a/src/index.tsx b/src/index.tsx index 45625ac19..2c30b3571 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -35,6 +35,7 @@ import { WindowTitle } from "./components/WindowTitle"; import { API_URI, APP_MOUNT_URI, GTM_ID } from "./config"; import ConfigurationSection, { createConfigurationMenu } from "./configuration"; import AppStateProvider from "./containers/AppState"; +import BackgroundTasksProvider from "./containers/BackgroundTasks"; import { CustomerSection } from "./customers"; import DiscountSection from "./discounts"; import HomePage from "./home"; @@ -135,11 +136,13 @@ const App: React.FC = () => { - - - - - + + + + + + +