Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and Fetch Project functionality added #394

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import config from "@/lib/config";
import * as z from "zod"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
import { DataTableLoading } from "../../components/shared/data-table-loading";
import { DataTableLoading } from "../../../components/shared/data-table-loading";


const formSchema = z.object({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export default function Layout({

return (
<>
<RootLayout/>
<RootLayout>
{children}

</RootLayout>
</>
);
}
29 changes: 0 additions & 29 deletions apps/client-ts/src/app/api-keys/layout.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions apps/client-ts/src/app/b2c/profile/layout.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions apps/client-ts/src/app/configuration/layout.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions apps/client-ts/src/app/connections/layout.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions apps/client-ts/src/app/dashboard/layout.tsx

This file was deleted.

21 changes: 15 additions & 6 deletions apps/client-ts/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Inter } from "next/font/google";
import "./globals.css";
import { Provider } from "@/components/Provider/provider";
import { Toaster } from "@/components/ui/sonner"
import {ThemeProvider} from '@/components/Nav/theme-provider'

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -17,12 +18,20 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>
<Provider>
{children}
<Toaster />
</Provider>
<html lang="en" suppressHydrationWarning>
<body className={`${inter.className} overflow-hidden`}>
<ThemeProvider
attribute="class"
defaultTheme="light"
enableSystem
disableTransitionOnChange
>
<Provider>
{children}
<Toaster />
</Provider>
</ThemeProvider>

</body>
</html>
);
Expand Down
8 changes: 4 additions & 4 deletions apps/client-ts/src/components/Nav/main-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export function MainNav({
onLinkClick: (name: string) => void;
className: string;
}) {
const [selectedItem, setSelectedItem] = useState<string>("connections");
const [selectedItem, setSelectedItem] = useState<string>("");
const pathname = usePathname();
useEffect(() => {
setSelectedItem(pathname.substring(1))
}, [pathname])

const navItemClassName = (itemName: string) =>
`text-sm border-b font-medium w-full text-left px-4 py-2 dark:hover:bg-zinc-900 hover:bg-zinc-200 cursor-pointer ${
selectedItem === itemName ? 'dark:bg-zinc-800 bg-zinc-200' : 'text-muted-foreground'
`group flex items-center rounded-md px-3 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground cursor-pointer ${
selectedItem === itemName ? 'bg-accent' : 'transparent'
} transition-colors`;

function click(e: MouseEvent, name: string) {
Expand All @@ -29,7 +29,7 @@ export function MainNav({

return (
<nav
className={`flex flex-col items-start ${className}`}
className={`grid items-start gap-2 ${className}`}
{...props}
>
<a
Expand Down
9 changes: 9 additions & 0 deletions apps/client-ts/src/components/Nav/theme-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use client"

import * as React from "react"
import { ThemeProvider as NextThemesProvider } from "next-themes"
import { type ThemeProviderProps } from "next-themes/dist/types"

export function ThemeProvider({ children, ...props }: ThemeProviderProps) {
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
}
40 changes: 40 additions & 0 deletions apps/client-ts/src/components/Nav/theme-toggle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"use client"

import * as React from "react"
import { MoonIcon, SunIcon } from "@radix-ui/react-icons"
import { useTheme } from "next-themes"

import { Button } from "@/components/ui/button"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
type ToggleProps = {};
export function ThemeToggle({} : ToggleProps) {
const { setTheme } = useTheme()

return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="outline" size="icon">
<SunIcon className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<MoonIcon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem onClick={() => setTheme("light")}>
Light
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("dark")}>
Dark
</DropdownMenuItem>
<DropdownMenuItem onClick={() => setTheme("system")}>
System
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
)
}
Loading
Loading