accounts-frontend/packages/app/components/profile/Context.tsx

20 lines
507 B
TypeScript
Raw Normal View History

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