1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-19 01:25:51 +07:00

Refactor(#209): Converted App component from class to func

This commit is contained in:
Priscila Oliveira
2019-11-24 19:21:08 +01:00
committed by GitHub
parent 0a48906fc8
commit 0d9232a92c
16 changed files with 520 additions and 304 deletions

23
src/App/AppContext.ts Normal file
View 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;