feat: apply conditional mation styling

This commit is contained in:
Ali BARIN
2023-12-14 14:28:07 +00:00
parent f8c30c8526
commit 78ba18b176
5 changed files with 50 additions and 14 deletions

View File

@@ -5,11 +5,15 @@ import { GET_AUTOMATISCH_INFO } from 'graphql/queries/get-automatisch-info';
export type AutomatischInfoContextParams = {
isCloud: boolean;
isMation: boolean;
loading: boolean;
};
export const AutomatischInfoContext =
React.createContext<AutomatischInfoContextParams>({
isCloud: false,
isMation: false,
loading: true,
});
type AutomatischInfoProviderProps = {
@@ -23,13 +27,15 @@ export const AutomatischInfoProvider = (
const { data, loading } = useQuery(GET_AUTOMATISCH_INFO);
const isCloud = data?.getAutomatischInfo?.isCloud;
const isMation = data?.getAutomatischInfo?.isMation;
const value = React.useMemo(() => {
return {
isCloud,
loading
isMation,
loading,
};
}, [isCloud, loading]);
}, [isCloud, isMation, loading]);
return (
<AutomatischInfoContext.Provider value={value}>