mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Merge branch 'dev' into ci-chromatic
This commit is contained in:
@@ -7,9 +7,9 @@ export default function OnboardingLayout({
|
||||
}) {
|
||||
return (
|
||||
<div className="flex min-h-screen w-full items-center justify-center bg-gray-100">
|
||||
<div className="mx-auto flex w-full flex-col items-center">
|
||||
<main className="mx-auto flex w-full flex-col items-center">
|
||||
{children}
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
68
autogpt_platform/frontend/src/app/(platform)/layout.tsx
Normal file
68
autogpt_platform/frontend/src/app/(platform)/layout.tsx
Normal file
@@ -0,0 +1,68 @@
|
||||
import { ReactNode } from "react";
|
||||
import { Navbar } from "@/components/agptui/Navbar";
|
||||
import { IconType } from "@/components/ui/icons";
|
||||
|
||||
export default function PlatformLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<Navbar
|
||||
links={[
|
||||
{
|
||||
name: "Marketplace",
|
||||
href: "/marketplace",
|
||||
},
|
||||
{
|
||||
name: "Library",
|
||||
href: "/library",
|
||||
},
|
||||
{
|
||||
name: "Build",
|
||||
href: "/build",
|
||||
},
|
||||
]}
|
||||
menuItemGroups={[
|
||||
{
|
||||
items: [
|
||||
{
|
||||
icon: IconType.Edit,
|
||||
text: "Edit profile",
|
||||
href: "/profile",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
icon: IconType.LayoutDashboard,
|
||||
text: "Creator Dashboard",
|
||||
href: "/profile/dashboard",
|
||||
},
|
||||
{
|
||||
icon: IconType.UploadCloud,
|
||||
text: "Publish an agent",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
icon: IconType.Settings,
|
||||
text: "Settings",
|
||||
href: "/profile/settings",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
icon: IconType.LogOut,
|
||||
text: "Log out",
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<main>{children}</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,17 +1,14 @@
|
||||
import React from "react";
|
||||
import React, { Suspense } from "react";
|
||||
import type { Metadata } from "next";
|
||||
import { Inter, Poppins } from "next/font/google";
|
||||
import { GoogleAnalytics } from "@next/third-parties/google";
|
||||
import { GeistSans } from "geist/font/sans";
|
||||
import { GeistMono } from "geist/font/mono";
|
||||
import { headers } from "next/headers";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import "./globals.css";
|
||||
|
||||
import { Navbar } from "@/components/agptui/Navbar";
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
import { IconType } from "@/components/ui/icons";
|
||||
import { Providers } from "@/app/providers";
|
||||
import TallyPopupSimple from "@/components/TallyPopup";
|
||||
import OttoChatWidget from "@/components/OttoChatWidget";
|
||||
@@ -34,9 +31,6 @@ export default async function RootLayout({
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
}>) {
|
||||
const pathname = headers().get("x-current-path");
|
||||
const isOnboarding = pathname?.startsWith("/onboarding");
|
||||
|
||||
return (
|
||||
<html
|
||||
lang="en"
|
||||
@@ -56,68 +50,11 @@ export default async function RootLayout({
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<div className="flex min-h-screen flex-col items-stretch justify-items-stretch">
|
||||
{!isOnboarding && (
|
||||
<Navbar
|
||||
links={[
|
||||
{
|
||||
name: "Marketplace",
|
||||
href: "/marketplace",
|
||||
},
|
||||
{
|
||||
name: "Library",
|
||||
href: "/library",
|
||||
},
|
||||
{
|
||||
name: "Build",
|
||||
href: "/build",
|
||||
},
|
||||
]}
|
||||
menuItemGroups={[
|
||||
{
|
||||
items: [
|
||||
{
|
||||
icon: IconType.Edit,
|
||||
text: "Edit profile",
|
||||
href: "/profile",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
icon: IconType.LayoutDashboard,
|
||||
text: "Creator Dashboard",
|
||||
href: "/profile/dashboard",
|
||||
},
|
||||
{
|
||||
icon: IconType.UploadCloud,
|
||||
text: "Publish an agent",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
icon: IconType.Settings,
|
||||
text: "Settings",
|
||||
href: "/profile/settings",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
items: [
|
||||
{
|
||||
icon: IconType.LogOut,
|
||||
text: "Log out",
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
<main className="w-full flex-grow">{children}</main>
|
||||
{children}
|
||||
<TallyPopupSimple />
|
||||
<OttoChatWidget />
|
||||
<Suspense fallback={null}>
|
||||
<OttoChatWidget />
|
||||
</Suspense>
|
||||
</div>
|
||||
<Toaster />
|
||||
</Providers>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useToast } from "@/components/ui/use-toast";
|
||||
import useAgentGraph from "../hooks/useAgentGraph";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
import { GraphID } from "@/lib/autogpt-server-api/types";
|
||||
import { askOtto } from "@/app/build/actions";
|
||||
import { askOtto } from "@/app/(platform)/build/actions";
|
||||
|
||||
interface Message {
|
||||
type: "user" | "assistant";
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
SubmissionStatus,
|
||||
} from "@/lib/autogpt-server-api/types";
|
||||
import { PaginationControls } from "../../ui/pagination-controls";
|
||||
import { getAdminListingsWithVersions } from "@/app/admin/marketplace/actions";
|
||||
import { getAdminListingsWithVersions } from "@/app/(platform)/admin/marketplace/actions";
|
||||
import { ExpandableRow } from "./expandable-row";
|
||||
import { SearchAndFilterAdminMarketplace } from "./search-filter-form";
|
||||
|
||||
|
||||
@@ -15,7 +15,10 @@ import { Label } from "@/components/ui/label";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import type { StoreSubmission } from "@/lib/autogpt-server-api/types";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { approveAgent, rejectAgent } from "@/app/admin/marketplace/actions";
|
||||
import {
|
||||
approveAgent,
|
||||
rejectAgent,
|
||||
} from "@/app/(platform)/admin/marketplace/actions";
|
||||
|
||||
export function ApproveRejectButtons({
|
||||
version,
|
||||
|
||||
@@ -64,7 +64,7 @@ export const Navbar = async ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<nav className="sticky top-0 z-50 mx-[16px] hidden h-16 items-center justify-between rounded-bl-2xl rounded-br-2xl border border-white/50 bg-white/5 py-3 pl-6 pr-3 backdrop-blur-[26px] dark:border-gray-700 dark:bg-gray-900 md:inline-flex">
|
||||
<nav className="sticky top-0 z-40 mx-[16px] hidden h-16 items-center justify-between rounded-bl-2xl rounded-br-2xl border border-white/50 bg-white/5 py-3 pl-6 pr-3 backdrop-blur-[26px] dark:border-gray-700 dark:bg-gray-900 md:inline-flex">
|
||||
<div className="flex items-center gap-11">
|
||||
<div className="relative h-10 w-[88.87px]">
|
||||
<IconAutoGPTLogo className="h-full w-full" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { logout } from "@/app/login/actions";
|
||||
import { logout } from "@/app/(platform)/login/actions";
|
||||
import { IconLogOut } from "@/components/ui/icons";
|
||||
|
||||
export const ProfilePopoutMenuLogoutButton = () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import { useLibraryPageContext } from "@/app/library/state-provider";
|
||||
import { useLibraryPageContext } from "@/app/(platform)/library/state-provider";
|
||||
import LibrarySortMenu from "./library-sort-menu";
|
||||
|
||||
export default function LibraryActionSubHeader(): React.ReactNode {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useEffect, useState, useCallback } from "react";
|
||||
|
||||
import { useBackendAPI } from "@/lib/autogpt-server-api/context";
|
||||
|
||||
import { useLibraryPageContext } from "@/app/library/state-provider";
|
||||
import { useLibraryPageContext } from "@/app/(platform)/library/state-provider";
|
||||
import { useScrollThreshold } from "@/hooks/useScrollThreshold";
|
||||
import LibraryAgentCard from "./library-agent-card";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import debounce from "lodash/debounce";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Search, X } from "lucide-react";
|
||||
import { useBackendAPI } from "@/lib/autogpt-server-api/context";
|
||||
import { useLibraryPageContext } from "@/app/library/state-provider";
|
||||
import { useLibraryPageContext } from "@/app/(platform)/library/state-provider";
|
||||
|
||||
export default function LibrarySearchBar(): React.ReactNode {
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useBackendAPI } from "@/lib/autogpt-server-api/context";
|
||||
import { LibraryAgentSortEnum } from "@/lib/autogpt-server-api/types";
|
||||
import { useLibraryPageContext } from "@/app/library/state-provider";
|
||||
import { useLibraryPageContext } from "@/app/(platform)/library/state-provider";
|
||||
import { ArrowDownNarrowWideIcon } from "lucide-react";
|
||||
import {
|
||||
Select,
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
import { updateSettings } from "@/app/profile/(user)/settings/actions";
|
||||
import { updateSettings } from "@/app/(platform)/profile/(user)/settings/actions";
|
||||
import { toast } from "@/components/ui/use-toast";
|
||||
import {
|
||||
NotificationPreference,
|
||||
|
||||
@@ -2,7 +2,6 @@ import { updateSession } from "@/lib/supabase/middleware";
|
||||
import { type NextRequest } from "next/server";
|
||||
|
||||
export async function middleware(request: NextRequest) {
|
||||
request.headers.set("x-current-path", request.nextUrl.pathname);
|
||||
return await updateSession(request);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user