From 1c9128a31c93d058950b0e149e3d790a4886e047 Mon Sep 17 00:00:00 2001 From: Naveen MC <8493007+mcnaveen@users.noreply.github.com> Date: Mon, 12 Aug 2024 20:18:26 +0530 Subject: [PATCH 001/267] fix(sidebar): :bug: conditionally hide signout button when collapsed --- apps/postgres-new/components/sidebar.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/postgres-new/components/sidebar.tsx b/apps/postgres-new/components/sidebar.tsx index b9b2d0ce..b8f2cccc 100644 --- a/apps/postgres-new/components/sidebar.tsx +++ b/apps/postgres-new/components/sidebar.tsx @@ -200,6 +200,7 @@ export default function Sidebar() {
Toggle theme
+ {user && (Sign out
+ + postgres.new + {' '} + is in early Alpha and in active development. We are working on mobile support for{' '} + + PGlite + {' '} + right now. +
++ In the meantime, please check out the video below or visit from a laptop or desktop. +
+We appreciate your patience and interest! Stay tuned for updates!
++
To prevent abuse we ask you to sign in before chatting with AI.
+{ + setIsSignInDialogOpen(true) + }} + > + Why do I need to sign in? +
)}To prevent abuse we ask you to sign in before chatting with AI.
+{ + setIsSignInDialogOpen(true) + }} + > + Why do I need to sign in? +
)} diff --git a/apps/postgres-new/components/sidebar.tsx b/apps/postgres-new/components/sidebar.tsx index b8f2cccc..3cb87929 100644 --- a/apps/postgres-new/components/sidebar.tsx +++ b/apps/postgres-new/components/sidebar.tsx @@ -30,6 +30,7 @@ import { downloadFile, titleToKebabCase } from '~/lib/util' import { cn } from '~/lib/utils' import { useApp } from './app-provider' import { CodeBlock } from './code-block' +import SignInButton from './sign-in-button' import ThemeDropdown from './theme-dropdown' import { DropdownMenu, @@ -40,7 +41,7 @@ import { } from './ui/dropdown-menu' export default function Sidebar() { - const { user, signOut, focusRef } = useApp() + const { user, signOut, focusRef, isSignInDialogOpen, setIsSignInDialogOpen } = useApp() let { id: currentDatabaseId } = useParams<{ id: string }>() const router = useRouter() const { data: databases, isLoading: isLoadingDatabases } = useDatabasesQuery() @@ -48,6 +49,37 @@ export default function Sidebar() { return ( <> +