mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-10 01:52:04 +05:30
23 lines
506 B
TypeScript
23 lines
506 B
TypeScript
import React from 'react';
|
|
import { FormModel } from 'app/components/ui/form';
|
|
|
|
export interface ProfileContext {
|
|
userId: number;
|
|
onSubmit: (options: {
|
|
form: FormModel;
|
|
sendData: () => Promise<any>;
|
|
}) => Promise<void>;
|
|
goToProfile: () => Promise<void>;
|
|
}
|
|
|
|
const Context = React.createContext<ProfileContext>({
|
|
userId: 0,
|
|
async onSubmit() {},
|
|
async goToProfile() {},
|
|
});
|
|
Context.displayName = 'ProfileContext';
|
|
|
|
export const { Provider, Consumer } = Context;
|
|
|
|
export default Context;
|