speed-flowchart-web/src/data/Context.tsx

30 lines
675 B
TypeScript
Raw Normal View History

2022-07-29 00:36:15 +02:00
import { Breakpoint } from '@mui/material/styles';
2022-07-27 02:55:05 +02:00
import { createContext } from 'react';
import { DigitalrockAPi } from './DigitalrockApi';
/**
* Creates a Context that is accessible to all nodes wrapped in the context provider
* @return {React.Context}
*/
export const Context = createContext<{
api: DigitalrockAPi;
2022-07-28 19:39:06 +02:00
title: string;
setTitle: (title: string) => void;
2022-07-29 00:36:15 +02:00
containerMaxWidth: false | Breakpoint | undefined;
setContainerMaxWidth: (maxWidth: false | Breakpoint | undefined) => void;
2022-07-27 02:55:05 +02:00
}>({
api: new DigitalrockAPi(),
2022-07-28 19:39:06 +02:00
title: '',
setTitle: () => {
return;
},
2022-07-29 00:36:15 +02:00
containerMaxWidth: 'lg',
setContainerMaxWidth: () => {
return;
},
2022-07-27 02:55:05 +02:00
});