saleor-dashboard/src/apps/context.ts
Lukasz Ostrowski 8f58efcd50
Rebuild App Settings to be nested inside app screen (#3676)
* Rebuild App Settings to be nested inside app screen

* Remove memoization

* Update src/apps/components/AppPage/AppPageNav.tsx

Co-authored-by: Michał Droń <droniu@droniu.dev>

---------

Co-authored-by: Michał Droń <droniu@droniu.dev>
2023-05-22 08:35:35 +02:00

21 lines
564 B
TypeScript

/* eslint-disable @typescript-eslint/no-empty-function */
import React from "react";
export interface AppListContextValues {
removeAppInstallation: (installationId: string) => void;
retryAppInstallation: (installationId: string) => void;
}
export const AppListContext = React.createContext<
AppListContextValues | undefined
>(undefined);
export const useAppListContext = () => {
const context = React.useContext(AppListContext);
if (!context) {
throw new Error("useAppListContext must be used within a AppListContext");
}
return context;
};