Skip to content

Commit

Permalink
fix: login
Browse files Browse the repository at this point in the history
  • Loading branch information
afordigital committed Aug 6, 2024
1 parent 0c2041c commit 2282e2d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions app/components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client";

/* eslint-disable @next/next/no-img-element */
import { useCursors } from "app/cursors-context";
import { Button } from "./ui/button";
Expand All @@ -8,7 +10,7 @@ import { useAuth } from "@/hooks/useAuth";
import Image from "next/image";
import { useOnClickOutside } from "@/hooks/useOnClickOutside";
import { useRef, useState } from "react";
import { useRouter } from "next/router";
import { useRouter } from "next/navigation";

export const Nav = () => {
const router = useRouter();
Expand All @@ -18,8 +20,9 @@ export const Nav = () => {

const [isOpen, setIsOpen] = useState(false);
const modalRef = useRef<HTMLDivElement | null>(null);
const trigger = useOnClickOutside(modalRef, ({ isSameTrigger }) =>
setIsOpen(isSameTrigger)
const trigger = useOnClickOutside<HTMLDivElement>(
modalRef,
({ isSameTrigger }) => setIsOpen(isSameTrigger)
);

const slice = 3;
Expand Down Expand Up @@ -69,8 +72,12 @@ export const Nav = () => {
</div>
<Button>Inscribirse</Button>
{user ? (
<div>
<button>
<div ref={trigger}>
<button
onClick={() => {
setIsOpen(true);
}}
>
<Image
src={user?.user_metadata.avatar_url}
alt="user avatar image"
Expand Down

0 comments on commit 2282e2d

Please sign in to comment.