forked from sombochea/verdaccio-ui
Refactor(#209): Converted App component from class to func
This commit is contained in:
committed by
GitHub
parent
0a48906fc8
commit
0d9232a92c
23
src/App/AppContext.ts
Normal file
23
src/App/AppContext.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { createContext } from 'react';
|
||||
|
||||
import { FormError } from '../components/Login/Login';
|
||||
|
||||
export interface AppProps {
|
||||
error?: FormError;
|
||||
user?: User;
|
||||
scope: string;
|
||||
packages: any[];
|
||||
}
|
||||
|
||||
export interface User {
|
||||
username: string;
|
||||
}
|
||||
|
||||
export interface AppContextProps extends AppProps {
|
||||
setUser: (user?: User) => void;
|
||||
setError: (error?: FormError) => void;
|
||||
}
|
||||
|
||||
const AppContext = createContext<undefined | AppContextProps>(undefined);
|
||||
|
||||
export default AppContext;
|
||||
Reference in New Issue
Block a user