@@ -39,26 +60,15 @@ export function SmallNav({
- setOpen(false)}>
- Panora.
+ setOpen(false)}>
+ {theme == "light" ? : }
+
diff --git a/apps/client-ts/src/components/Nav/main-nav.tsx b/apps/client-ts/src/components/Nav/main-nav.tsx
index 0c477c8c7..73bb49dff 100644
--- a/apps/client-ts/src/components/Nav/main-nav.tsx
+++ b/apps/client-ts/src/components/Nav/main-nav.tsx
@@ -19,7 +19,7 @@ export function MainNav({
}, [pathname])
const navItemClassName = (itemName: string) =>
- `group flex items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground cursor-pointer ${
+ `group flex items-center rounded-md px-2 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground cursor-pointer ${
selectedItem === itemName ? 'bg-accent' : 'transparent'
} transition-colors`;
@@ -63,7 +63,7 @@ export function MainNav({
target="_blank"
rel="noopener noreferrer"
>
-
Documentation
+
Docs
diff --git a/apps/client-ts/src/components/Nav/user-nav.tsx b/apps/client-ts/src/components/Nav/user-nav.tsx
index e42590d71..386520d9f 100644
--- a/apps/client-ts/src/components/Nav/user-nav.tsx
+++ b/apps/client-ts/src/components/Nav/user-nav.tsx
@@ -6,25 +6,36 @@ import {
import { Button } from "@/components/ui/button"
import {
DropdownMenu,
+ DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
+ DropdownMenuPortal,
DropdownMenuSeparator,
+ DropdownMenuSub,
+ DropdownMenuSubContent,
+ DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import useProfileStore from "@/state/profileStore";
import { useRouter } from "next/navigation";
import Link from "next/link";
import Cookies from 'js-cookie';
-import useProjectStore from "@/state/projectStore"
+import useProjectStore from "@/state/projectStore";
import { useQueryClient } from '@tanstack/react-query';
+import {User,LogOut,SunMoon,Sun,Moon,Monitor} from 'lucide-react';
+import {DotsHorizontalIcon} from '@radix-ui/react-icons';
+import { useTheme } from "next-themes";
+
export function UserNav() {
const router = useRouter();
const { profile, setProfile } = useProfileStore();
const { setIdProject } = useProjectStore();
const queryClient = useQueryClient();
+ const { setTheme,theme } = useTheme();
+ // const [currentTheme,SetCurrentTheme] = useState(theme)
const onLogout = () => {
router.push('/b2c/login')
@@ -36,37 +47,79 @@ export function UserNav() {
return (
-
-
-
+
+ {/*
{profile ? profile.email || profile.first_name : "No profile found"}
-
-
+ */}
+ {/* */}
- Profile
+
+ Profile
+
+
+
+
+ Theme
+
+
+
+ setTheme("light")}
+ >
+
+ Light
+
+ setTheme("dark")}
+ >
+
+ Dark
+
+ setTheme("system")}
+ >
+
+ System
+
+
+
+
+
{/*
Billing
Settings
*/}
-
+ {/* */}
onLogout()} >
- Log out
+
+ Log Out
diff --git a/apps/client-ts/src/components/RootLayout/index.tsx b/apps/client-ts/src/components/RootLayout/index.tsx
index a54968a2b..64f90ff34 100644
--- a/apps/client-ts/src/components/RootLayout/index.tsx
+++ b/apps/client-ts/src/components/RootLayout/index.tsx
@@ -13,10 +13,15 @@ import { ThemeToggle } from '@/components/Nav/theme-toggle';
import useProjects from '@/hooks/get/useProjects';
import useRefreshAccessTokenMutation from '@/hooks/create/useRefreshAccessToken';
import { useTheme } from 'next-themes';
+import { useState } from "react";
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
+import { Button } from "@/components/ui/button";
+import { toast } from "sonner";
export const RootLayout = ({children}:{children:React.ReactNode}) => {
const router = useRouter()
const base = process.env.NEXT_PUBLIC_WEBAPP_DOMAIN;
+ const [copiesProjectID, SetCopiesProjectID] = useState
(false);
const {data : projectsData} = useProjects();
const { idProject, setIdProject } = useProjectStore();
const {mutate : refreshAccessToken} = useRefreshAccessTokenMutation()
@@ -42,9 +47,23 @@ export const RootLayout = ({children}:{children:React.ReactNode}) => {
}
};
+ const handleCopyRight = () => {
+ navigator.clipboard.writeText(idProject);
+ toast.success("Project ID copied!", {
+ action: {
+ label: "Close",
+ onClick: () => console.log("Close"),
+ },
+ })
+ SetCopiesProjectID(true);
+ setTimeout(() => {
+ SetCopiesProjectID(false);
+ }, 2000);
+ };
+
return (
<>
-
+ {/*
-
+
*/}
+
)
}
diff --git a/apps/embedded-catalog/react/src/components/PanoraIntegrationCard.tsx b/apps/embedded-catalog/react/src/components/PanoraIntegrationCard.tsx
index 5b385f52f..92e2d4822 100644
--- a/apps/embedded-catalog/react/src/components/PanoraIntegrationCard.tsx
+++ b/apps/embedded-catalog/react/src/components/PanoraIntegrationCard.tsx
@@ -4,33 +4,47 @@ import { CONNECTORS_METADATA, ConnectorCategory } from '@panora/shared';
import { Button } from './ui/button2';
import { Card } from './ui/card';
import { ArrowRightIcon } from '@radix-ui/react-icons';
+import {ArrowLeftRight} from 'lucide-react'
+import Modal from './Modal';
+
+
export interface ProviderCardProp {
name: string;
category: ConnectorCategory;
projectId: string;
- returnUrl: string;
linkedUserId: string;
optionalApiUrl?: string,
}
-const PanoraIntegrationCard = ({name, category, projectId, returnUrl, linkedUserId, optionalApiUrl}: ProviderCardProp) => {
- const [loading, setLoading] = useState(false)
+const PanoraIntegrationCard = ({name, category, projectId, linkedUserId, optionalApiUrl}: ProviderCardProp) => {
+ const [loading, setLoading] = useState(false);
+ const [openSuccessDialog,setOpenSuccessDialog] = useState(false);
const [startFlow, setStartFlow] = useState(false);
+ const returnUrlWithWindow = (typeof window !== 'undefined')
+ ? window.location.href
+ : '';
+
const { open, isReady } = useOAuth({
providerName: name.toLowerCase(),
vertical: category.toLowerCase() as ConnectorCategory,
- returnUrl: returnUrl,
+ returnUrl: returnUrlWithWindow,
+ // returnUrl: window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : ''),
+ // returnUrl: returnUrl,
projectId: projectId,
linkedUserId: linkedUserId,
optionalApiUrl: optionalApiUrl,
- onSuccess: () => console.log('OAuth successful'),
+ onSuccess: () => {
+ console.log('OAuth successful');
+ setOpenSuccessDialog(true);
+ },
});
const onWindowClose = () => {
setLoading(false);
- return;
+ setStartFlow(false);
+ // return;
}
useEffect(() => {
@@ -39,7 +53,7 @@ const PanoraIntegrationCard = ({name, category, projectId, returnUrl, linkedUser
} else if (startFlow && !isReady) {
setLoading(false);
}
- }, [startFlow, isReady, open]);
+ }, [startFlow, isReady]);
const handleStartFlow = () => {
@@ -78,6 +92,26 @@ const PanoraIntegrationCard = ({name, category, projectId, returnUrl, linkedUser