- Run npm install to install all dependencies
- Make sure env.local file exists
- After sign up, go to prisma studio and create a profile record with the user id in the Profile table
- User id can be obtained from the profile-registration page after you register an account
- A user row is created everytime a user signs up
- Reference: https://www.youtube.com/watch?v=0N6M5BBe9AE
- Add import Layout from "~/components/layout/Layout"; on top of the page
- Paste this code at the end of every page
Settings.getLayout = function getLayout(page: ReactElement) {
return (
<>
<Layout>{page}</Layout>
</>
);
};
export default Settings;
- Replace Settings with the name of the page eg. ResearchPostsPage
- import { useSupabaseClient } from "@supabase/auth-helpers-react";
- Create a supabase client instance using the useSupabaseClient hook
const supabase = useSupabaseClient();
- Use the supabase client instance to call the auth methods. For instance, forget password reference here: https://supabase.com/docs/guides/auth/auth-password-reset
- You can also use the useUser hook to get details of the current user
import { useUser } from "@supabase/supabase-js";
const { user } = useUser();
console.log(user);
- On terminal, run: npm install react-hot-toast
- import on necessary pages to use:
import toast, { Toaster } from 'react-hot-toast';
const notify = () => toast('Here is your toast.');
const App = () => {
return (
<div>
<button onClick={notify}>Make me a toast</button>
<Toaster />
</div>
);
};
- On terminal, run npm run dev