Skip to content

Instantly share code, notes, and snippets.

View SahanAmarsha's full-sized avatar
🏠
Working from home

Sahan Amarsha SahanAmarsha

🏠
Working from home
View GitHub Profile
@SahanAmarsha
SahanAmarsha / DashboardLayout.tsx
Created January 17, 2023 10:05
Dashboard Layout Component
.
.
import LoadingSpinner from "./LoadingSpinner";
import useAuth from "../hooks/useAuth";
.
.
const DashboardLayout = () => {
const navigate = useNavigate();
const [open, setOpen] = React.useState(true);
const { isAuthenticating, isAuthenticated, signOut } = useAuth();
@SahanAmarsha
SahanAmarsha / SignIn.tsx
Created January 17, 2023 10:10
Add 'signIn()' to SignIn.tsx page
.
.
import useAuth from "../hooks/useAuth";
import { useEffect } from "react";
import LoadingSpinner from "../components/LoadingSpinner";
export default function SignIn() {
const navigate = useNavigate();
const { signIn, isAuthenticated, isAuthenticating } = useAuth();
.