From e170d04d5d2c8c86d2683f3accb4feb2d94c881a Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 30 Jun 2020 01:34:51 +0300 Subject: style: fix linting errors --- src/hooks/useAuth.tsx | 4 ++-- src/hooks/useNavigate.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/hooks') diff --git a/src/hooks/useAuth.tsx b/src/hooks/useAuth.tsx index de64c46..55e142c 100644 --- a/src/hooks/useAuth.tsx +++ b/src/hooks/useAuth.tsx @@ -24,7 +24,7 @@ const authContext = createContext({ const useProvideAuth = () => { const [user, setUser] = useState(null); - const login = (username: string, password: string, remember = true): Promise => { + const login: ContextType['login'] = (username, password, remember = true) => { return post('/authentication', { strategy: 'local', username, @@ -71,7 +71,7 @@ export const AuthProvider: React.FC = ({ children }) => { return {children}; }; -export const useAuth = () => { +export const useAuth = (): ContextType => { return useContext(authContext); }; diff --git a/src/hooks/useNavigate.tsx b/src/hooks/useNavigate.tsx index 9513f13..befc529 100644 --- a/src/hooks/useNavigate.tsx +++ b/src/hooks/useNavigate.tsx @@ -22,7 +22,7 @@ const context = createContext({ const useProvideNavigation = () => { const [page, setPage] = useState(landingPage); - const navigate = (prefix: string, id?: string): void => { + const navigate: ContextType['navigate'] = (prefix, id?) => { setPage({ prefix, id }); }; @@ -35,7 +35,7 @@ export const NavigationProvider: React.FC = ({ children }) => { return {children}; }; -export const useNavigate = () => { +export const useNavigate = (): ContextType => { return useContext(context); }; -- cgit v1.2.3