add user context and likes

This commit is contained in:
Aaron William Po
2023-02-08 07:43:59 -05:00
parent 20000cc4af
commit f6880deeb6
12 changed files with 300 additions and 47 deletions

View File

@@ -1,6 +1,14 @@
import useUser from '@/hooks/useUser';
import '@/styles/globals.css';
import type { AppProps } from 'next/app';
import UserContext from './contexts/userContext';
export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />;
const { user, isLoading, error } = useUser();
return (
<UserContext.Provider value={{ user, isLoading, error }}>
<Component {...pageProps} />
</UserContext.Provider>
);
}