20 lines
507 B
TypeScript
Raw Normal View History

2019-12-12 09:26:23 +02:00
import React from 'react';
import { FormModel } from 'app/components/ui/form';
export interface ProfileContext {
2020-05-24 02:08:24 +03:00
userId: number;
onSubmit: (options: { form: FormModel; sendData: () => Promise<any> }) => Promise<void>;
goToProfile: () => Promise<void>;
2019-12-12 09:26:23 +02:00
}
const Context = React.createContext<ProfileContext>({
2020-05-24 02:08:24 +03:00
userId: 0,
async onSubmit() {},
async goToProfile() {},
2019-12-12 09:26:23 +02:00
});
Context.displayName = 'ProfileContext';
export const { Provider, Consumer } = Context;
export default Context;