From 32fe79fe36fe10754b05119b24ac91ac46baeece Mon Sep 17 00:00:00 2001 From: patrickwebsdev Date: Fri, 8 Nov 2024 05:22:21 -0300 Subject: [PATCH] fix: sidebar toggle on click login button --- src/app/signup/page.tsx | 19 +++++++++++++++++++ src/components/UserInfo.tsx | 7 ++++++- src/components/auth/SocialButton.tsx | 1 + src/components/layout/Sidebar.tsx | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/app/signup/page.tsx diff --git a/src/app/signup/page.tsx b/src/app/signup/page.tsx new file mode 100644 index 00000000..81f2221e --- /dev/null +++ b/src/app/signup/page.tsx @@ -0,0 +1,19 @@ +'use client'; +import SignUp from '@/components/auth/SignUp'; +import { useRouter, useSearchParams } from 'next/navigation'; +import React, { Suspense } from 'react'; + +export default function SignUpPage() { + return ( + + + + ); +} + +function SignUpComponent() { + const router = useRouter(); + const params = useSearchParams(); + console.log(params); + return router.push('/')} />; +} diff --git a/src/components/UserInfo.tsx b/src/components/UserInfo.tsx index 6c60f787..50d55d1e 100644 --- a/src/components/UserInfo.tsx +++ b/src/components/UserInfo.tsx @@ -6,7 +6,11 @@ import { authService } from '@/lib/service'; import { useSession } from '@/context/SessionProvider'; import Image from 'next/image'; -export default function UserProfile() { +type UserProfileProps = { + toggleAction?: () => void; +}; + +export default function UserProfile({ toggleAction }: UserProfileProps) { const session = useSession(); const user = session.user; @@ -22,6 +26,7 @@ export default function UserProfile() { Inicia sesiĆ³n diff --git a/src/components/auth/SocialButton.tsx b/src/components/auth/SocialButton.tsx index 1f79a4e2..5b43792b 100644 --- a/src/components/auth/SocialButton.tsx +++ b/src/components/auth/SocialButton.tsx @@ -11,6 +11,7 @@ type SocialButtonProps = { export default function SocialButton({ provider, redirectUrl, children }: SocialButtonProps) { const baseUrl = process.env.NEXT_PUBLIC_ENV === 'production' ? process.env.NEXT_PUBLIC_BASE_URL! : 'http://127.0.0.1:3000'; + console.log(baseUrl + redirectUrl); const handleLogin = async (provider: Provider) => { const { data, error } = await supabase.auth.signInWithOAuth({ provider, diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index 5f9d4ed6..eba48fe2 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -254,7 +254,7 @@ export default function Sidebar({ isOpen, toggleAction }: SidebarProps) { {/* User info and login */}
- +
{/* Toggle button for desktop */}